in reply to Forgot variable syntax for $var = funct() or "Funct failed\n" / Any experience with is_hostname()
The other monks have answered your question; if you want to check precedence issues yourself, B::Deparse can be very useful:
$ perl -MO=Deparse -e 'my $foo = somefunc() or "text"' '???' unless my $foo = somefunc(); $ perl -MO=Deparse,-p -e 'my $foo = somefunc() or "text"' ((my $foo = somefunc()) or '???'); $ perl -MO=Deparse,-p -e 'my $foo = somefunc() || "text"' (my $foo = (somefunc() || 'text'));
|
|---|