Hash problem
From: Mike Blezien (mickalo_at_frontiernet.net)
Date: 12/26/04
- Next message: Randy W. Sims: "Re: Hash problem"
- Previous message: John: "Bash to Perl/C"
- Next in thread: Randy W. Sims: "Re: Hash problem"
- Reply: Randy W. Sims: "Re: Hash problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 26 Dec 2004 10:44:14 -0600 To: Perl List <beginners@perl.org>
Hello,
I'm working on settup a hash something like this:
my $catid = 'A';
my(%conf);
$conf{cat} = {
A => (
["15.00","Three months(90days)","90"],
["30.00","Six months(180 days)","180"],
["45.00","Nine months(270 days)","270"],
["60.00","Twelve months(365 days)","365"]
),
B => (
["20.00","Three months(90days)","90"],
["40.00","Six months(180 days)","180"],
["50.00","Nine months(270 days)","270"],
["70.00","Twelve months(365 days)","365"]
)
};
print header();
for (my $i=0; $i<@{$conf{cat}->{$catid}}; $i++) {
print qq~CatPrice: $conf{cat}->{$catid}[0] CatDays:
$conf{cat}->{$catid}[2]<BR>~;
}
But all I'm getting is the first element array in key 'A'
"15.00 90" instead of all 4 array in the key in the loop... what I'm I doing
wrong, or is there away doing this better ??
TIA
-- Mike(mickalo)Blezien =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Thunder Rain Internet Publishing Providing Internet Solutions that work! =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Next message: Randy W. Sims: "Re: Hash problem"
- Previous message: John: "Bash to Perl/C"
- Next in thread: Randy W. Sims: "Re: Hash problem"
- Reply: Randy W. Sims: "Re: Hash problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]