On 12/18/2011 08:53 PM, David Christensen wrote:
beginners@perl.org:
I'm working on some classes with attributes that are array and hash
references, and am confused by what happens when I attempt to slice an
array or hash reference. For example:
7. "$ra->[0, 1, 2]" evaluates to $ra->[2].
8. "$
On 12/18/2011 06:05 PM, John W. Krahn wrote:
$ra is a scalar that holds a reference to an array. $ra->[0]
dereferences an array element. To dereference an array slice use:
@{ $ra }[ 0, 1, 2 ]
...
@{ $ra }[ 0 .. 2 ]
On 12/18/2011 06:14 PM, Shawn H Corey wrote:
> my @slice = @$ra[ 1, 2, 3 ];
..
On 11-12-18 09:05 PM, John W. Krahn wrote:
David Christensen wrote:
beginners@perl.org:
Hello,
I'm working on some classes with attributes that are array and hash
references, and am confused by what happens when I attempt to slice an
array or hash reference. For example:
7. "$ra->[0, 1, 2]"
David Christensen wrote:
beginners@perl.org:
Hello,
I'm working on some classes with attributes that are array and hash
references, and am confused by what happens when I attempt to slice an
array or hash reference. For example:
7. "$ra->[0, 1, 2]" evaluates to $ra->[2].
$ra is a scalar th