If I execute "./myscript.pl -f foo.bar", I get nothing returned, as though the $opts{f} is empty. Sure I'm missing something simple. Can one of you Monks help me out? Thanksuse Getopt::Std; # declare the perl command line flags/options we want to allow my %opts; getopts('f:', %opts); # test for the existence of the options on the command line. if ($opts{f}) { my $file eq $opts{f}; print "$file\n"; }
In reply to GetOpts not working: by finfan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |