To return the first line I'd saysub first_line_from_file { my $fn = shift; open my $file, "<", $fn or die "unable to open file $fn"; <$file> }
(The semicolon is cosmetic. But I consider it good style)scalar <$file>;
In reply to Re^2: Reopen file when contents changed?
by blazar
in thread Reopen file when contents changed?
by bofh_of_oz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |