There's more than one way to do things | |
PerlMonks |
Re: Is this bad coding style?by fullermd (Priest) |
on Jan 08, 2009 at 04:45 UTC ( [id://734801]=note: print w/replies, xml ) | Need Help?? |
So $_ is compared against "# using "eq" (for strings) and against the integer 1 using "==" (for numbers). Is that a bad style? Well, it would be much worse style to compare against # using ==, and against 1 using eq :) It can be a perfectly reasonable means to an end. Whether it's a reasonable means to this end, though, is pretty hard to say. Particularly since there's no end suggested, just a means. Depending on the end, the above suggestion by bobf could be a better means.
In Section
Seekers of Perl Wisdom
|
|