> ....snip..eg.
> I get,
>  f1|f2|f3f1|f2|f3 
> <eof>
> vs. what I'd expect
>  f1|f2|f3
>  f1|f2|f3
> <eof>
> Is the fix just to make sure the last
> record has one "/n"...?

Kind of a problem I had with a flat-file db
when I made an insert. For what it's worth I did
some code that seems to be ok,
....
use Tie::File;
my $file='C:\threesharp\datatest.threesharp';
tie my @array, 'Tie::File', $file;
# remove blanks, other stuff from file end
while (1) {
  if ($array[$#array] =~ m/^\s*$/) { pop (@array); }
  else { last; }
}
# Tie::File's default behavior ensures one "/n" at record end
$array[$#array] = $array[$#array];
untie @array;


-- 
http://www.fastmail.fm - Choose from over 50 domains or use your own

Reply via email to