Hi,

Using Tie::File with recsep = "\n\n" adds two extra lines to the
original file when I iterate through the entire file. If I just change
one record then its fine.

Below is the program

use strict;
use warnings;

use Tie::File;

my @array;
tie @array, 'Tie::File', 'file', recsep => "\n\n" or die $!;

foreach my $rec ( @array ){
   print $rec;
}

untie @array;

$-> diff file file.orig
8464,8465d8463
<
<

Right now, I am tieing the file again without recsep and popping two records.

tie @array, 'Tie::File', 'file' or die $!;
pop(@array);
pop(@array);
untie @array;

This fixes the problem but is there a better way to get around this?

perl version is 5.8.0 and latest version of Tie::File (0.97).

Thanks,

--Ankur

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to