use warnings; use strict; print f() ."\n"; print f('hi') ."\n"; sub f { my $arg = defined $_[0] ? shift : 'default'; } #### default hi