Subject: | File::Tail does not respect $INPUT_RECORD_SEPARATOR when using using tail |
The "tail => N" attribute does not respect the $/ - $INPUT_RECORD_SEPARATOR for reading records. That would be a very nice feature.
Here is the output from the attached script:
./File-Tail.pl
more
____
____
block #9
____
multilined
____
more
____
____
block #10
____
multilined
____
more
____
____
^C
Subject: | File-Tail.pl |
#!/usr/bin/perl
use strict;
use warnings;
use English qw( -no_match_vars );
use File::Tail;
$INPUT_RECORD_SEPARATOR = "\n\n";
open( LOG, ">/tmp/fail.tail.bug" );
foreach my $i ( 0..10 ) {
print LOG "block #$i\nmultilined\nmore\n\n";
}
close( LOG );
my $file = File::Tail->new( name => "/tmp/fail.tail.bug", tail => 10 );
while ( defined( my $line=$file->read ) ) {
print $line;
} continue {
print "____\n";
}