Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: bash vs perl

by davidrw (Prior)
on Jan 11, 2008 at 15:02 UTC ( #661891=note: print w/ replies, xml ) Need Help??


in reply to bash vs perl

In general, just use the "right tool" for the job .. where that depends on the specific task and your knowledge/speed/ability in each, and relevant to that task..

BUT, that doesn't mean one or the other -- use the power of both at the same time!! the perl -x (see perlrun) makes this possible (sort of a trivial example, but hopefully shows the potential):

#!/bin/bash logrotate ..... # rotate out /data/file.txt perl -x $0 $@ > /data/file.txt 2>&1 mail -s "file.txt" me@example.com < /data/file.txt echo "Job done. Errors:" grep ERROR /data/file.txt exit ####### #!/usr/bin/perl # do whatever perl-friendly tasks -- process some files, do calculatio +ns, call CPAN modules for heavy lifting, whatever.


Comment on Re: bash vs perl
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-07-06 23:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls