Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Multidimensional Arrays

by Anonymous Monk
on May 28, 2003 at 07:47 UTC ( #261247=note: print w/ replies, xml ) Need Help??


in reply to Multidimensional Arrays

Beautiful description. I too have tried over and over to learn this. I ended up creating a moc multi-dimentional array with a hash:

 $qa{"Q1.A3"} ="Question 1, Answer 3"; # dbl Quotes required!

I can iterate through the array answers for Q1 like this:

   for $i (1..5) print $qa{"Q1.A$i"} . '\n';

As an added benefit, I can also create other "properties":

  $qa{"Q1.type"} = "radio";

So, that makes it sort of like a virtual object, which I need to learn someday. This was great. Thanks again. -sleve


Comment on Re: Multidimensional Arrays
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (12)
As of 2015-07-28 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls