I have a field "Prices"; there i save something like:
1|300,1.5|450,2|600
Now i want to split it with
@a = split(/,/,$t->{Prices});
I should have now something like:
$a[0] = 1|300
$a[1] = 1.5|450
$a[2] = 2|600
Now i walk tru with:
while (my ($key, $value) = each @a) {
@b = split(/\|/,$value);
}
Now i should have:
$a[1] = 300
$a[1.5] = 450
$a[2] = 600
again i want to walk tru:
while (my ($key, $value) = each @b) {
$output .= "For $key pieces you pay $value Dollar";
}
I got:
Unable to compile 'Rates': Type of arg 1 to each must be hash (not private array) at (eval 117) line 8, near "@a) " Type of arg 1 to each must be hash (not private array) at (eval 117) line 12, near "@b) "
and i have no idea what i should do now.
1|300,1.5|450,2|600
Now i want to split it with
@a = split(/,/,$t->{Prices});
I should have now something like:
$a[0] = 1|300
$a[1] = 1.5|450
$a[2] = 2|600
Now i walk tru with:
while (my ($key, $value) = each @a) {
@b = split(/\|/,$value);
}
Now i should have:
$a[1] = 300
$a[1.5] = 450
$a[2] = 600
again i want to walk tru:
while (my ($key, $value) = each @b) {
$output .= "For $key pieces you pay $value Dollar";
}
I got:
Unable to compile 'Rates': Type of arg 1 to each must be hash (not private array) at (eval 117) line 8, near "@a) " Type of arg 1 to each must be hash (not private array) at (eval 117) line 12, near "@b) "
and i have no idea what i should do now.