sub fooge { my ($foo, $bar) = (shift, shift); die "fooge() needs two arguments\n" unless (defined($bar)); # ... }