XP is just a number | |
PerlMonks |
Re: System vs modulesby mikeraz (Friar) |
on Aug 05, 2005 at 15:42 UTC ( [id://481285]=note: print w/replies, xml ) | Need Help?? |
Why use Perl at all? That, to me, is the essence of your question. If your Perl code is a sequence of system calls you could save yourself some grief with a shell script or batch file.
Certainly when you're starting in Perl a construct like Now your program will tag each line of your log message with the string PERLSEZ, include the process ID, and send it all to the mail logging system. Later on your program can (an action taken thousands of times a day by my system, but that's a different thread) Sys::Syslog provides full control over logging. Note that you don't get to specify the facility, which log type, with /usr/bin/logger. Along with the full control your openlog call will set up some global options so you don't have to specify them on each call. Handy. The other Perl replacements for varied system "command [args]" have their unique advantages. Best of all you get to do both. Use system ...; until you have a frustration with what it won't do for you then investigate what Perl and CPAN have to offer for alternatives. Play with a few, choose the one that floats your boat and implement it.
Be Appropriate && Follow Your Curiosity
In Section
Seekers of Perl Wisdom
|
|