[ABE.pm] data structures within data structures

Jim Eshleman jce0 at Lehigh.EDU
Fri Dec 31 11:49:09 CST 2004


Faber Fedor wrote:
> What mechanism in Perl do I want to do for the following:
> 
> I want to create an array/hash that contains in each row variables and
> arrays.  If I have two vars and an array, it might look something like
> this:
> 
>     my $ds =( {"1", "2", (a,b,c,d)   },
>               {"3", "4", (e,f,g)     },
> 	      {"5", "6", (h,i,j,k,l) }
> 	    );
> 
> How would I go about initializing/accessing the internal array elements?
> 
> The reason I'm doing this is I need to wrote six programs that all do
> the same thing; they differ only in the value of 4 variables and an
> array.  Instead, I want to write one program and just change the
> variables and array values.

   I don't understand the question/example, but you'll likely find what 
you need in "perldsc", the Perl Data Structures Cookbook:

   perldoc perldsc

Check out the CODE EXAMPLES section.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20041231/1d97efc6/signature.bin


More information about the ABE-pm mailing list