in reply to Re: Understanding Perl context (removing duplicates from array)
in thread Understanding Perl context
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: <%-(-(-(-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Understanding Perl context (removing duplicates from array)
by LanX (Saint) on Apr 19, 2015 at 13:29 UTC | |
by AnomalousMonk (Archbishop) on Apr 19, 2015 at 14:27 UTC | |
by LanX (Saint) on Apr 19, 2015 at 14:47 UTC |