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

Re^3: Can @ARGV work within Perl functions or is it just for script input?

by jasonk (Parson)
on Feb 10, 2009 at 16:46 UTC ( #742815=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can @ARGV work within Perl functions or is it just for script input?
in thread Can @ARGV work within Perl functions or is it just for script input?

Even in those cases, there are usually clearer solutions...

use Getopt::Long qw( GetOptionsFromArray ); sub do_awesome_things { GetOptionsFromArray( \@_, 'files=s' => \my @files, 'verbose!' => \my $verbose, ); warn "Going to process files @files. " . "Verbose is ".( $verbose ? 'ON' : 'OFF' ).".\n"; } do_awesome_things -v => -file => 'foo.txt', -file => 'bar.txt';

www.jasonkohles.com
We're not surrounded, we're in a target-rich environment!
  • Comment on Re^3: Can @ARGV work within Perl functions or is it just for script input?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://742815]
help
Chatterbox?
[Yaerox]: Is there any recommended perl-module for an CSPRNG in 2016?
[ambrus]: Yaerox: good question, I don't know

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2016-12-06 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (101 votes). Check out past polls.