in reply to which line(s) establishes a 2d arrray
is short for$ret{$j}[$i]
$ret{$j}->[$i]
In lvalue context (e.g. on the left of a "="), -> and other dereference operators will autovivify the reference. That means dereference operators will automatically create a variable of the required variable type (e.g. ->[...] will create a hash) and place a reference to it in the variable being dereferenced. This only happens if the variable being dereferenced is undef. In other words,
is short for$ret{$j}[$i]
( $ret{$j} //= [] )->[$i]
when used as an lvalue.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: which line(s) establishes a 2d arrray
by DanielM0412 (Acolyte) on Jul 28, 2011 at 19:58 UTC | |
by ikegami (Patriarch) on Jul 28, 2011 at 20:06 UTC |