Re: Perl versus UNIX Korn Shell

[email protected] (Danny Faught) Wed, 05 Nov 2003 19:20:26 -0600
Newsgroups perl.trainers
Message-ID <[email protected]>
Esposito, Anthony wrote:
> How would you convince someone that programming in Perl is better than 
> using the UNIX Korn Shell?
> 
> I need some ‘intellectual ammo’ to convince my colleagues that Perl is a 
> better, more powerful language, to do our scripting.  Any suggestions?  J

The shell doesn't do most of the work.  Mostly, you're calling external 
programs, like grep, cat, sort, etc.  These don't all have a consistent 
interface, and they differ from one system to another.  Plus, you'll 
likely end up having to learn sed and/or awk.

Why learn all these different tools, plus perhaps two additional 
languages (sed and awk)?  It's all available in Perl, plus much more, 
including a nice debugger.  And well-written Perl scripts are portable.

BTW, if you insist writing a shell script and need something like awk, 
why not use Perl instead of awk?

There are a few cases where I would favor bash over Perl - when it's 
easier to call several existing utilities than to install additional 
Perl modules (avoid the clutter of those system("...") calls), and when 
I have a very short script that needs to redirect its output to a file.
-- 
Danny R. Faught
Tejas Software Consulting
http://tejasconsulting.com/