#use default directory if argument not set on command line find(\&fileop, $opts{'directory'}) unless @ARGV; find(\&fileop, @ARGV) if @ARGV; #### #use default directory if argument not set on command line find(\&fileop, @ARGV ? @ARGV : $opts{'directory'});