# assuming you don't mind shifting off the first arg my $start = shift || 'e:\logs'; warn "$start doesn't exist" unless -e $start; # or whatever you want to do with the 'exception'