$ perl -s -foo=bar -e 'print $foo,$/ if $foo' Unrecognized switch: -foo=bar (-h will show valid options). # (and similarly with other arrangements of these args) $ cat junk.pl #!/usr/bin/perl -s print "$foo\n" if $foo; $ perl junk.pl $ perl junk.pl -foo 1 $ perl junk.pl -foo=bar 1 # (I thought that should have printed "bar", but # there must be some logical reason why it didn't.) $ chmod +x junk.pl $ junk.pl $ junk.pl -foo 1 $ junk.pl -foo=bar bar # at last! #### $ perl -se 'print "$foo\n" if $foo' -- -foo 1 $ perl -se 'print "$foo\n" if $foo' -- -foo=bar bar