[ale] Perl command line

larry at nemo.realminfo.com larry at nemo.realminfo.com
Wed Jun 10 11:30:09 EDT 1998


sure, use the @ARGV array

program arg1 arg2 arg3

($x, $y, $z) = @ARGV;

or you can use the Getopt module

use Getopt::Std;

getopt('isN');

if ($opt_i) {print "input: $opt_i";};
if ($opt_s) {print "speed: $opt_s";};
if ($opt_N) {print " Name: $opt_N";};

-LG

On Wed, 10 Jun 1998, Bob Kruger wrote:

> I am looking for some example Perl code for capturing a command line
> variable or variables.  
> 
> Example - I have a report that I generate on a daily basis.  I would like
> to be able to use the same code to generate one copy or ten copies.  If the
> default is one copy, I would like to be able to check at the beginning of
> the routine to see if a parameter such as "-n10" was entered, or for that
> matter, anything like -n.  
> 
> Anyone have any hints or examples?
> 
> Thanks in advance - Bob
> 






More information about the Ale mailing list