#! perl use strict; use warnings; use Getopt::Std; our ($opt_p, $opt_L); getopts('p:L'); # -p takes an argument, -L is a boolean flag print "p switch: $opt_p\n"; print "L switch: $opt_L\n";