Need help with perl loop!
Hello.
Here is the problem.
My cgi script receives variables.
@pairs = split(/&/, $query);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$variable{$name} = $value;
$name is $item_name1, $item_name2, $item_name3, $item_name4 ... etc
I would like to make a loop:
for ($count = 1; $count <= 100; $count++) {
($item_name,$item_number) = split(/\|/, $variable{'item_number$count});
print "$item_no, ";
}
however this does not work. I'm sure taht the problem is in:
$variable{'item_number$count}
What is the correct way of saying this in PERL?
Thanks.
|