Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Is this bad coding style?

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://734801]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2024-04-19 12:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found