use strict; use warnings; use Getopt::Long; my $foo; GetOptions ('foo:s', \$foo); print "foo: $foo\n" if defined($foo); print "Unprocessed by Getopt::Long\n" if $ARGV[0]; foreach (@ARGV) { print "$_\n"; }