Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Accepting either a filename or a handle

by cchampion (Curate)
on Jun 18, 2004 at 21:12 UTC ( #368068=note: print w/ replies, xml ) Need Help??


in reply to Accepting either a filename or a handle

What about named parameters?

sub doit { my %options = @_; if ($options{filename} ) { #use a filename } elsif ( $options{filehandle} ) { # use a filehandle } else { die "won't work"; } } doit( filename => 'somefile'); doit( filehandle => $fh );


Comment on Re: Accepting either a filename or a handle
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2014-12-26 04:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (165 votes), past polls