Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Array reference problem

by ikegami (Patriarch)
on Jul 07, 2009 at 16:17 UTC ( [id://777926]=note: print w/replies, xml ) Need Help??


in reply to Array reference problem

Why it's stupid to 'use a variable as a variable name'

my @descriptor_array = ( [ 1, 2, 3, 4 ], [ 2, 3, 4, 5 ], [ 3, 4, 5, 6 ], [ 4, 5, 6, 7 ], ); my @insomearray = (0, 3); for my $array_no (@insomearray) { my $array = $descriptor_array[$array_no]; print("$array_no $array @$array\n"); }
0 ARRAY(0x814ec28) 1 2 3 4 3 ARRAY(0x814f8e8) 4 5 6 7

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://777926]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-06-20 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.