use strict; use warnings; my $x=""; my $y=substr($x,2,1); # warns, doesn't crash foo($y); # no-op print "Alive\n"; # we get here just fine sub foo {}