use Tie::File; sub last_line_of_file { my $file = shift; tie my @array, 'Tie::File', $file or die "read $file - $!"; $array[-1] }
In reply to Re: How do I copy out the last line written in a file?
by I0
in thread How do I copy out the last line written in a file?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |