in reply to Value of a statement with modifier

It becomes quite clear when you rewrite it as

sub foo { if ($_[0]) { return 'hello'; } # go off the end of sub without return so return the last expression }