Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gawk into an array question



Eric Chadbourne wrote:
| you know what, awk is giving me pain.  i think you have just inspired me to write my first perl script.  we're running on linux and have perl installed.  i just glanced at the manual and it reminds me of php.  $ and ; and other familiar stuff.  thanks for the inspiration doug!

Careful there; perl is known to be highly addictive. ;-)

This example is one of the reasons, though perhaps not for the reason
that most people would guess.  Awk scripts can be easily converted to
perl, and are often simpler.  But the real reason is that awk can  be
quite  difficult  to debug.  It says "Bailing out in line 2", you say
"WTF???", and you tear your hair out trying to guess  what  you  said
that offended it.  Perl comes with an interactive debugger that's one
of the first things you should learn.  You can  install  breakpoints,
step  through  the  code, examine variables, modify them, and all the
usual stuff.  This is a huge relief after dealing with tools like awk
that  don't  help you at all.  Perl is a pretty good language in most
regards, but the real reason that people get addicted to it  is  that
it does things like this to make life easier for the programmer.

I often find myself starting to write a shell script,  and  8  or  10
lines  in  I  hit  something that makes me think "This would be a lot
easier in perl".  So I add a few dollar signs, semicolons and  braces
to make it into a perl script, and continue.


--
I ??? Unicode






BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org