I have a hash of hashes which I converted to an array of hashes because I 
needed to access them in a specific sequence.  It now looks like

my @pagetypes=(
        {'pagetype'=>'Delivery  Note','weight'=>2,.....
        {'pagetype'=>'Sales Invoice','weight'=>2,.....
        {'pagetype'=>'Purchase Invoice','weight'=>2,.....
..........

I then access the array using

foreach my $pt (@pagetypes) {


However, I have now lost the ability to access each pagetype by it's name

I am aware that you cannot define a key sequence when defining a hash.  
However, if I create a sequence field

my %pagetypes=(
        'Delivery  Note'=>{'seq'=>1,weight'=>2,.....
        'Sales Invoice'=>{'seq'=>2,'weight'=>2,.....
        'Purchase Invoice'=>{'seq'=>3,'weight'=>2,.....
..........

How can I do the foreach statement to access them in the correct sequence?

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to