URGENT: Hash in Hash, Array in Array, Array in Hash, Hash in Array 
Author Message
 URGENT: Hash in Hash, Array in Array, Array in Hash, Hash in Array

Dear friends,

How can I use :

Hash in hash, Array in Array, Hash in Array, Array in Hash.

I am doing an urgent project. I think the use listing above can solve my problem,
but how do I implement this in Perl ?

Thanks in advance,

Lan



Sat, 25 Jul 1998 03:00:00 GMT  
 URGENT: Hash in Hash, Array in Array, Array in Hash, Hash in Array

Quote:

>Dear friends,

>How can I use :

>Hash in hash, Array in Array, Hash in Array, Array in Hash.

>I am doing an urgent project. I think the use listing above can solve my problem,
>but how do I implement this in Perl ?

If you have WWW access then Tom Christiansen has written about perl data
structures in the perl data structures cookbook (PDSC) section of his web
site at http://www.*-*-*.com/

The perl data structures cookbok information is also part of the standard
set of manual pages which are supplied with perl starting from later
versions of perl 5.002b2, man perldsc should produce the manual page.

Hope this helps,

Mike

--
Mike Stok                        | The "`Stok' disclaimers" apply.


http://www.{*filter*}com.net/~stok/   | The inevitable WWW page (?)



Sun, 26 Jul 1998 03:00:00 GMT  
 URGENT: Hash in Hash, Array in Array, Array in Hash, Hash in Array
: Dear friends,

We'd be friendlier if you check the perl man pages and FAQs before posting.

: How can I use :
: Hash in hash, Array in Array, Hash in Array, Array in Hash.

'grep -i "array of array" ~/perl/faq/*'  reveals:

5.2) How can I make an array of arrays or other recursive data types?

--
  Tad McClellan,      Logistics Specialist (IETMs and SGML guy)

  All I want, is a little more than I'll ever get.



Sun, 26 Jul 1998 03:00:00 GMT  
 URGENT: Hash in Hash, Array in Array, Array in Hash, Hash in Array

Quote:

>Dear friends,

>How can I use :

>Hash in hash, Array in Array, Hash in Array, Array in Hash.

>I am doing an urgent project. I think the use listing above can solve my problem,
>but how do I implement this in Perl ?

>Thanks in advance,

>Lan


If you are using perl5, then do things like:


$array[1] = \%subhash;   #hash in array

$hash{'key'} = \%subhash;#hash in hash

then you can do

$array[0][5]
$array[1]->{'subkey'}
$hash{'key'}->{'subkey'}
$hash{'key'}->[4]

Better still, do a 'man  perlref' and read all about it.

;-)

Jules



Fri, 31 Jul 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. hash of values and array of hashes of values and array of hashes

2. array/hash to file to array/hash

3. Simple Perl5 question (hash-array of hash-array refs)

4. question regarding hash hash hash of array

5. Help with perl hashes of hashes and arrays of hashes etc

6. baby steps with complex hashes of hashes of hashes of arrays

7. Hash of Hashes of Arrays

8. Sorting array of hash references by a hash key

9. Pushing onto hash of hash of array

10. hash of hashes of arrays

11. complex foreach loop with deep hashes (sorted hash slices (using an array for keys))

12. Weird Perl hash of hash of array

 

 
Powered by phpBB® Forum Software