in reply to Command line args
Update : Bah, runrig beat me to it.#it's easy, mm-kay? a snippet from one of my scripts. use Getopt::Long; my %opt = (); GetOptions(\%opt, "rhost=s", # remote host as a (s)tring "ruser=s", # remote username as a (s)tring "rpwd=s", # remote password as a (s)tring "localDir=s", # local directory as a (s)tring ) or die "Invalid Command Line Options!\n"; #then use like this do_this() if $opt{rhost}; do_that() if $opt{ruser}; chdir $opt{localDir}; #etc etc
|
---|