Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Some suggestions on coding style - a chance to critiqueby abaxaba (Hermit) |
on Jun 26, 2002 at 15:21 UTC ( [id://177401]=note: print w/replies, xml ) | Need Help?? |
First off, this looks a lot like something from Mr. Wright. Bag it. Use Mime::Lite or something like that for the mailing. But kudos for using pass-by-ref. I see lots of pass-by-val, and that drives me nuts. A couple of other things, but maybe just preference:
This keeps the brackets lined up vertically, and helps me keep track of deeply nested loops. Of course, this is certainly preference, and doesn't really have much to do wrt the code.
I hate stuff like this. Assigning variables to hash values, IMHO, should only be done if you have some really complex data structures, and even then, I believe you should use some sort of interpolation, lest you continue to de-ref every time you access something.
Use standard if-then/ternary syntax here. Make perl figure out which case you're on before assigning the $method values. AFAIK, in your code, it assigns the value, then will pitch it if the conditional isn't met. Don't waste the cycles. HTH, and again, much of this may be just preference.
In Section
Meditations
|
|