in reply to Reopen file when contents changed?
just once per second? performance is not going to be an issue: use the aproach that seems simpler for you.
I would go for...
sub first_line_from_file { my $fn = shift; open my $file, "<", $fn or die "unable to open file $fn"; scalar <$file> }
update: added the scalar in front of <$file>. blazar, thanks for pointing it out.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Reopen file when contents changed?
by blazar (Canon) on Jun 07, 2005 at 14:05 UTC |
In Section
Seekers of Perl Wisdom