in reply to Perl vs. Shell Script

The biggest point, which Abigail already made, is that there's hardly such a thing as a pure shell script. You need other Unix tools to do fancy stuff.

That can be clumsy. find trickery often leads to spawning hundreds of processes. sed is fun since it's small and light and can get things done quick&dirty. sort is a hackjob more often than not. awk is missing the ward to complete the name and is clumsy enough that I've never really gotten to use it - I find myself moving the script to Perl sooner than I get a chance to play with awk.

I enjoy working on the shell immensely (after 10 years of COMMAND.COM, who wouldn't?), but when scripting it depends on the complexity. The point when I abandon bash and move to Perl is when I need more than 3 or 4 calls to external tools to get the job done. Sometimes that limit is as tight as it seems, sometimes - because bash is quite powerful - it's enough. More demanding stuff is likely done better in Perl. (I saw a suite of CGI scripts for system administration once - written in bash. A very surreal experience.) Most of my scripts start out as some semicomplex command I find myself using repeatedly. When I get tired of typing, I dump the sequence into a shell script. As time goes by I find myself tweaking the script to be more generically usable. I often hit a brick wall with the shell at that point and things get really clunky. Transition to Perl is then just a logical step.

Makeshifts last the longest.