Perl (or Unix vs. MS, actually)
Steven W. Orr
steveo at syslang.net
Tue Aug 20 16:52:35 EDT 2002
On Tue, 20 Aug 2002 pll at lanminds.com wrote:
=>
=>In a message dated: Tue, 20 Aug 2002 15:16:58 CDT
=>Thomas Charron said:
=>
=>For example, in shell, the construct:
=>
=> cd /tmp && rm foo
Whotchoo talkin 'bout Willis?
cd == chdir is a builtin command. But point taken.
=>
=>creates 2 sub-shell processes, whereas, in perl:
=>
=> chdir (/tmp) && unlink(foo);
=>
=>creates 0 sub-shell processes. Therefore, perl is, technically, more
=>efficient in this regard. Does it really matter with todays
=>ridiculously overpowered CPUs and gobs of memory? Probably not in
=>most cases.
=>
=>Though, perl does have a debugger one can use vs. bash which doesn't.
=>That right there is a plus in the perl column for me! :)
Actually, debugging bash isn't all that bad.
set -x
will solve lots of problems and if that doesn't get you going, then
set -xv
will probably do the rest of it. Another great debugging technique is to
set
PS4='.+${0##*/} line $LINENO: '
Also, while bash is arguably the best *login* shell, the best shell
scripting language (aside from perl, but I don't consider that to be a
scripting language in the first place) is ksh. And, BTW, the real ksh93 is
available for free in rpm format, no less. And there is a full blown
debugger available for ksh with breakpoints and everything. :-)
--
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question? steveo at syslang.net
More information about the gnhlug-discuss
mailing list