array of arrays of arrays 
Author Message
 array of arrays of arrays




array?

Thanks

Alexandros V



Sat, 20 Dec 2003 19:34:53 GMT  
 array of arrays of arrays

Quote:

> Subject: array of arrays of arrays

perldoc perllol

Right, there's you problem.  Surely you meant:


would be anonymous and quite possibly autovivified.

Quote:

> array?



--
     \\   ( )
  .  _\\__[oo

 .  l___\\
  # ll  l\\
 ###LL  LL\\



Sat, 20 Dec 2003 19:44:56 GMT  
 array of arrays of arrays

    $B1[42] = 'content';

Quote:
> and how can i print the content of that array?


However, you probably want something else. If you have the following:









    ('a', 'b', 'c', 'x', 'y', 'z', 'A', 'B', 'C', 'X', 'Y', 'Z')

-- that is, you won't be able to tell which element came from which
original array, because the arrays were 'flattened' into one list. (Or,
put a little differently, Perl isn't Python.) You'll almost certainly
want to learn about references; instead of storing an array's elements
in another array, store a reference to the array. The documents perlref,
perllol, and perldsc should be helpful. In this example:








Now you can access the 'z' as $A[0]->[1]->[2] (or $A[0][1][2], if you

this:


Hope this helps.

Cheers,
Philip    

[1] Actually, $"-separated.
--

Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.



Sat, 20 Dec 2003 21:40:02 GMT  
 array of arrays of arrays

Quote:




> array?

Use references to prevent the array structures from being flattened.  See
perldoc perldsc for how.

Graham Wood

  Graham.T.Wood.vcf
< 1K Download


Sat, 20 Dec 2003 23:11:10 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. URGENT: Hash in Hash, Array in Array, Array in Hash, Hash in Array

2. Separating array into alphabetical array of arrays

3. Help with Embedding and Arrays of Arrays?

4. Passing arrays of arrays in perlxs

5. arrays of arrays

6. Changing One Array Changes Unrelated Arrays -- Why?

7. (Q) array of associative arrays

8. Dividing an array into individual arrays.

9. Associative array of associate arrays

10. array of arrays?

11. Array of Associative Arrays?

12. array of arrays!?!

 

 
Powered by phpBB® Forum Software