http://www.perlmonks.org?node_id=1063350


in reply to Re^3: Search logs with crontab
in thread Search logs with crontab

"As to your original approach with replacing strings, this also can be done, but this requires opening file in "read-write" mode open(FILE, "+<mylog.file")."

There's also a potential "gotcha" here. That being; permissions. The subject file (in +RW) will require the maintenance of not only the current RWX bits, but that the script implementer has sufficient rights, and doesn't change ownership of said file.

All in all, seems keeping markers in a separate file would probably be the most sensible approach -- FAR less overhead.

--Chris

#!/usr/bin/perl -Tw
use Perl::Always or die;
my $perl_version = (5.12.5);
print $perl_version;