{ package OPTS; use Getopt::Std; our %opts; getopts('fs', \%opts); } #### our %opts; *opts = \%OPTS::opts; if ($OPTS::opts{f}) { #do stuff }