sub foo { defined(my $x = shift) or warn "No parameter given!" # ... }