in reply to Re: Reopen file when contents changed?
in thread Reopen file when contents changed?
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 Section
Seekers of Perl Wisdom