Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Wrong idioms

by vsespb (Chaplain)
on Mar 30, 2013 at 09:43 UTC ( #1026261=note: print w/replies, xml ) Need Help??


in reply to Wrong idioms

sub readfile { my $filename = shift or return; ... }
If this code should only check that filename is defined (i.e. allow empty string), you can write (even for perl <5.10) it like this:
defined(my $filename = shift) or return;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026261]
help
Chatterbox?
[LanX]: obscure facts: only naturally born monks can become president here!

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-03-24 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (304 votes). Check out past polls.