Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: I most recently did it in the...

by zakzebrowski (Curate)
on Mar 28, 2004 at 16:54 UTC ( #340406=note: print w/replies, xml ) Need Help??


in reply to I most recently did it in the...

sub whatisit{ my $it = shift; if ($it eq 'yada yada'){ return(undef); } else { if ($it eq 'get in a car accident'){ return("vincinity of 38.86540N 77.07163W"} else { if ($it eq 'write perl script'){ return ('kitchen'); } else{ return(\&email(zak)); } } } }


----
Zak - the office

Replies are listed 'Best First'.
Re^2: I most recently did it in the...
by Nkuvu (Priest) on Mar 28, 2004 at 22:17 UTC
    You know, you can reduce the level of indentation (thus making it easier to read (IMHO, of course)) of this sub by using elsif:

    sub whatisit{ my $it = shift; if ($it eq 'yada yada'){ return(undef); } elsif ($it eq 'get in a car accident') { return("vincinity of 38.86540N 77.07163W"); } elsif ($it eq 'write perl script'){ return ('kitchen'); } else{ return(\&email(zak)); } }

    I know this is pretty trivial code, but...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://340406]
help
Chatterbox?
[choroba]: I don't see it when XP doesn't change either
[marinersk]: That has always been its behavior, but I'm a visual/spacial- awareness guy. When the node disappears, it messes with my head, even though it is on the right margin.
[marinersk]: I was hoping there was a way to turn it on and make it stay on.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2017-05-29 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?