[ale] Perl command line

Chris Hamilton chrish at ifsintl.com
Wed Jun 10 11:26:02 EDT 1998


> I am looking for some example Perl code for capturing a command line
> variable or variables.  

To avoid 'reinventing the wheel', I would suggest requiring 'getopts.pl'.
It comes packaged in your standard perl distribution and you can do
something like (quoted from the getopts.pl file):

;# Usage:
;#
;#    do Getopts('a:bc');  # -a takes arg. -b & -c not. Sets opt_* as a
;#                         #  side effect.

For this example, $opt_a is populated with the argument required by 'a'

--
Christopher Hamilton            Internal System Administrator
chrish at ifsintl.com              IFS International, Inc.






More information about the Ale mailing list