
shawnhcorey
Enthusiast

Jan 8, 2011, 8:40 AM
Post #3 of 3
(741 views)
|
|
Re: [makals] about array in array
[In reply to]
|
Can't Post
|
|
hello see this: $ref = [ 1, 2, [ 10, 20 ] ]; $element = {$ref->[2]}->[1]; what is it mean the [2] and [1] ?
It means nothing.
perl -e'$ref = [ 1, 2, [ 10, 20 ] ]; > $element = {$ref->[2]}->[1]; ' Not an ARRAY reference at -e line 2. Perhaps you meant
perl -e'$ref = [ 1, 2, [ 10, 20 ] ]; > $element = $ref->[2]->[1]; ' Though it is commonly written as
perl -e'$ref = [ 1, 2, [ 10, 20 ] ]; > $element = $ref->[2][1]; ' __END__ I love Perl; it's the only language where you can bless your thingy. Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib. Get Markup Help. Please note the markup tag of "code".
|