A hash slice initializing undef values is better written as @unordered{@array}=() , assigning undef to the first element is misleading! [emphasis added]
IMHO, this statement is itself a bit misleading. The two forms of the statement are exactly equivalent! The effect of either () or undef as the RHS of the assignment is exactly the same because both are equivalent to lists of undef values of exactly the same length as the @array array. This slightly obscure point must be understood regardless of the assignment used, and neither assignment seems to me better suited to making this point.
Give a man a fish: <%-(-(-(-<
In reply to Re^2: Understanding Perl context (removing duplicates from array)
by AnomalousMonk
in thread Understanding Perl context
by shankonit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |