use strict; use warnings; use Getopt::Std; my %opts; getopts('b:l:', \%opts); if (! exists $opts{b} || ! exists $opts{l}) { die "Both -b and -l options are required\n"; } print "-b: $opts{b}, -l $opts{l}\n";