in reply to Use command line argument in script

perlintro#Writing subroutines, perlvar#@ARGV, Data::Dump::dd ( Basic debugging checklist ), GetOpt::Long, perlrun# s
$ perl -se " use Data:::Dump qw/ dd /; dd( \@ARGV, $pan ) " -- -pan=ca +kes ro sham bo (["ro", "sham", "bo"], "cakes") $ perl -e " use Data::Dump qw/ dd /; use Getopt::Long; my %opt; GetOpt +ions( \%opt, qw[ pan=s bo! ]); dd( \%opt , \@ARGV ) " -- -pan=cakes +bi bicky by -bo bo ({ bo => 1, pan => "cakes" }, ["bi", "bicky", "by", "bo"]) $ perl -e " use Data::Dump qw/ dd /; Main( @ARGV ); sub Main { dd( \@_ + ); } " ba bay bi bi bo bicky bi bo bo ["ba", "bay", "bi", "bi", "bo", "bicky", "bi", "bo", "bo"]

Modern Perl a loose description of how experienced and effective Perl 5 programmers work....You can learn this too.