Hi, Wiggins, :)

On Mon, 11 Nov 2002, Wiggins d'Anconia wrote:

> This solution works well and is clean, if you are curious about some
> of the *magic* he is performing in his foreach I would suggest
> reading up on the special variable $_ for those of us experienced in
> perl it isn't as daunting to just throw a foreach (@array) in the
> code and know that it is going to work on $_ so that something like
> s/regex/replace/g; which appears to just hang in space isn't
> skipped, but is again working on that $_ that mysteriously jumped
> into the code.  I prefer explicitly giving the temp variable a name
> so that I know (and more importantly the people after me know) what
> the hell I was doing and to what, but to each his own.

Good call, dude.  Sorry about that, Doug!  I'm normally pretty anal
about using descriptive variable names and obvious grammar/punctuation
('m_' anyone?).  Wiggins is right - one of the frustrating things
about learning Perl is that there are so many shortcuts and seemingly
non-intuitive things (like, what does '$!' mean?) that reading the
code of an expert can be daunting, and I don't by *any* *means*
consider myself an expert.  My background and training has always been
geared towards programs that are expressive and immediately
understandable as opposed to elegant but terse.

Then again, there are some Perl idioms that are just too useful to
leave on the cutting room floor.  While these can be easily abused, I
think they have their place, too.  When used judiciously, they can
actually *clear* *out* some of the line-noise and extraneous text that
sometimes inhibits understanding in other languages.  Fine line,
though.

---Jason


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to