use strict; use warnings; use Getopt::Std; my %opts; getopts('m:b',\%opts); print $opts{m} . "\n"; print "The boolean -b option was set!\n" if defined $opts{b}; print "The boolean -b option was not set!\n" if undef $opts{b};