Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Indirect access of an array

by zeltus (Beadle)
on Nov 11, 2011 at 12:34 UTC ( #937570=perlquestion: print w/replies, xml ) Need Help??
zeltus has asked for the wisdom of the Perl Monks concerning the following question:

Once again it is Friday and my brain is fried. I have a number of arrays.. @a_1, @a_2,@a_3 I have a variable $n; How do I use it to access any of the three arrays as in $n = 2; print Dumper(@_$n); or even $y = "_" . $n print Dumper(@$y); (these don't work by the way - especially when "use strict" is in force. Which it is) I have done this, I know I have but I can't do it now. As I said, it's friday. As ever, all help gratefully received.

Replies are listed 'Best First'.
Re: Indirect access of an array
by moritz (Cardinal) on Nov 11, 2011 at 12:45 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://937570]
Approved by moritz
help
Chatterbox?
[1nickt]: ugh, buying a computer is hard for an old person
[stevieb]: How do you mean?
[1nickt]: They assume that I want things I don;t and don;t provide things I do want. Looking for a 17" laptop with 4k (even 3K display) and full numeric-pad keyboard.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2017-03-26 17:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (315 votes). Check out past polls.