#! perl -slw use strict; sub morefoo{ $_[0] * 3 } sub a { my $x = shift; return defined $x ? morefoo( $x ) : undef; } sub b { my $x; return defined( $x = shift ) ? morefoo( $x ) : undef; } sub c { return morefoo( shift // return undef ); } print "$_ :> ", a( $_ ) for undef, 0, 1 ; print "$_ :> ", b( $_ ) for undef, 0, 1 ; print "$_ :> ", c( $_ ) for undef, 0, 1 ; __END__ C:\test>junk93 Use of uninitialized value $_ in concatenation (.) or string at C:\test\junk93.pl line 21. Use of uninitialized value in print at C:\test\junk93.pl line 21. :> 0 :> 0 1 :> 3 Use of uninitialized value $_ in concatenation (.) or string at C:\test\junk93.pl line 23. Use of uninitialized value in print at C:\test\junk93.pl line 23. :> 0 :> 0 1 :> 3 Use of uninitialized value $_ in concatenation (.) or string at C:\test\junk93.pl line 25. Use of uninitialized value in print at C:\test\junk93.pl line 25. :> 0 :> 0 1 :> 3