Permalink
Browse files

From the mailing list:

  Date: Tue, 25 Feb 2003 16:28:11 -0800
  From: Jim Westfall <jwestfall@surrealistic.net>
  To: poe@perl.org
  Subject: FollowTail behavior change with SeekBack

  I recently upgraded to 0.25 from 0.23 and noticed there is a
  behavior change to FollowTail with the SeekBack option.  A
  'SeekBack' => 0 is now causing it to seek back instead of seeking to
  the EOF like one would expect.  The code was as follows

     my $seek_back = ( (defined $params{SeekBack})
                        ? $params{SeekBack}
                        : 4096
                      );

  and has been changed to

    my $seek_back     = $params{SeekBack} || 4096;

  so now if $params{SeekBack} is undefined or set to 0 it will make
  $seek_back 4096.  simple workaround on my part is to set SeekBack to
  -1.

  A simular situation exists with the PollInterval option, tho I dunno
  if 0 would be a valid option for it.

__END__

This was a short sided change.  The old behaviour is correct and has
been restored.
  • Loading branch information...
1 parent 1cf45a9 commit 5fcd5c895fe5088168d16e863ae7fc38f06f633a @cwest cwest committed Feb 27, 2003
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/POE/Wheel/FollowTail.pm
@@ -103,8 +103,10 @@ sub new {
@start_stat = stat($filename);
}
- my $poll_interval = $params{PollInterval} || 1;
- my $seek_back = $params{SeekBack} || 4096;
+ my $poll_interval = defined($params{PollInterval}) ?
+ $params{PollInterval} : 1;
+ my $seek_back = defined($params{SeekBack}) ?
+ $params{SeekBack} : 4096;
$seek_back = 0 if $seek_back < 0;
my $self = bless

0 comments on commit 5fcd5c8

Please sign in to comment.