sub foo {} #foo(substr "hello", 10, 1); # fatal error as you pointed out #foo(+substr "hello", 10, 1); # I thought this would be a workaround foo(scalar substr "hello", 10, 1); # but you need something like this print "This only gets printed if the last line didn't cause a fatal error\n"; #### perl -e '+$a = "Hello, world!\n"; print $a' Hello, world!