Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^4: Search logs with crontab

by taint (Chaplain)
on Nov 19, 2013 at 15:44 UTC ( #1063350=note: print w/replies, xml ) Need Help??

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.


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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1063350]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2016-10-23 01:00 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (299 votes). Check out past polls.