sub foo{ my $bar = defined $_[0] ? $_[0] : 'default'; # ... }