![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: guidance with a realtime log readerby thewebsi (Scribe) |
on Aug 29, 2013 at 19:32 UTC ( #1051505=note: print w/replies, xml ) | Need Help?? |
Since Perl integrates well with the shell, you can also transition stepwise into a full Perl implementation. For example, start with a command-line script: >tail -f /var/log/ldap.log | perl -ne 'if ( /connection_input: conn=11/ ) { system ( "send an email" ); system ( "restart ldap" ); }'Then move the code into a Perl script file: >tail -f /var/log/ldap.log | process.plThen take over the function of tail in Perl: >process.plAnd finally maybe replace some of the system calls with Perl equivalents (eg, Mail::Sendmail)...
Arnon Weinberg Back2Front - The Web Site People
In Section
Seekers of Perl Wisdom
|
|