Using a colon ":" instead of the equals sign indicates that the option value is optional. In this case, if no suitable value is supplied, string valued options get an empty string '' assigned, while numeric options are set to 0. #### 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"; }