Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: (crazyinsomniac) Re: Coding superstitions

by talexb (Canon)
on Jan 09, 2002 at 19:37 UTC ( #137464=note: print w/ replies, xml ) Need Help??


in reply to Re: (crazyinsomniac) Re: Coding superstitions
in thread Coding superstitions

I would replace that entire routine with the ? thingie, as in

sub fred { return ( ( $_[0] eq 'ooyah' ) ? 1 : 0 ); }
Gee, I didn't realize until I was replying that you used == and I corrected that to eq. Not bad for some guy who wrote C code forever.

And I disagree with the lecturer about leaving the last return to dangle -- what he/she suggested is obsfucation, and you're not doing yourself any favours with that approach.

--t. alex

"Excellent. Release the hounds." -- Monty Burns.


Comment on Re: Re: (crazyinsomniac) Re: Coding superstitions
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2015-07-02 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (37 votes), past polls