http://www.perlmonks.org?node_id=21654


in reply to Grouping Symbols?
in thread or or

AFAIK, the examples you gave still pose a problem. What if you were to assign the return value of open() to a variable:

$foo = open(FH, "filename.txt") || die $!; # not the same as $foo = open(FH, "filename.txt") or die $!;

but they appear to be the same anyway ;) It's not the parentheses that's doing it, it's just the way it works. It's checking to see if the return of open() is true, and if not, tries to assign the return value of die to $foo, which never happens because it dies.

So it works the same either way, but it's actually doing two different things.

local $_ = "0A72656B636148206C72655020726568746F6E41207473754A"; while(s/..$//) { print chr(hex($&)) }