I would like to pass in some variables via the command line. For example,
I want to be able to run the program the following way.
perl program.pl -u my_username -p my_password
Where the -u switch signifies the following string is the user name and
the -p switch is for their password. Can you help me on how to do this?
it is simple. The command line parameters are in the array @_ thus
$_ is '-u'
$_ is 'my_username'
and so on
[ back to toc ]