for (1..4){ print "$_: "; if ( ($str) = func($_) ) { # list assignment only false for empty list print "Success $str\n"; } else { print "Error $Error::message"; } } sub func { $Error::message="Wrong wrong wrong!!"; goto "L".shift; L1: return ""; L2: return 0; L3: return undef; L4: return; # blank returns empty list } __DATA__ 1: Success 2: Success 0 Use of uninitialized value $str in concatenation (.) or string at /tmp/tst2.pl line 4. 3: Success 4: Error Wrong wrong wrong!!