Hello monks, could you please help me understand this syntax? Why do we have parentheses around FOO/BAR in the hash? Thanks a bunch!
use constant FOO => 10; use constant BAR => 20; %BAZ = ( FOO() => 1, BAR() => 1 ); sub is_baz { my $i = shift; return ( exists $BAZ{$i} ) ? 1 : 0; } .... is_baz(10);
In reply to understanding this syntax by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |