Heylo again,
I've been trying to make my program somewhat easier to maintain. I have an array which I declare:
my @pizza = ($p1 = "Pizza One", $p2 = "Pizza Two" );
I then go ahead and put this @Pizza array in another array, like so:
my @food = (\@pizza);
When I attempt to access either $p1 or $p2 via the @food property I get a value returned like "Array{0x8001}" which appears to be a memory reference. What i tried was this:
$test = ${$food[$pizza[$p1]]};
What is the corret way to access this? I am looking to NOT use indexes in order to ease program readability. could you guys point me in the right direction?
Regards,
This is what I am trying to do:
I have several databases (for talks sake this is an example)
Database One
Table One (D1T1) | Column One | Column Two | Column Three | Column Four
Table Two (D1T2) | Column One | Column Two | Column Three
Database Two
Table One (D2T1) | Column One | Column Two| Column Three
Table Two (D2T2) | Column One | Column Two| Column Three
Table Three (D2T2) | Column One | Column Two| Column Three
Between these two databases there is information that is relative to particular records right across them both. What I am trying to do is create an array (each array will represent a database) and insert variables (each variable will represent a table.field. within the datasource) Once I have done this I am creating an array to hold all teh arrays (The ones that represent the db's) as this array will represent a single entry right across the two databases which I can then act on. Example:
@D1 = ( t1.col1, t1.col4, t2.col1 ); @D2 = ( t1.col1, t2.col1, t3.col2, t3.col3);
@rec = ( \@D1, \@D2 );
If I want to know what was held in Database 2 -> Table 2 -> Column 4 what would the statement be? Should I be using hashes instead? I do have a requirement for this two dimensional array/hash.
Any help is much appreciated.
MC