in reply to Re: Accept array from Form and put in DB
in thread Accept array from Form and put in DB
The expression @quantity = [2,1] does not
assign two values into the array, it instead assigns an
anonymous array reference which contains two values into
the array. Did you mean @quantity = (2,1) instead?
Here is some more code to play with:
Update: this is a common pitfall that probably all of us have stumbled on at least once ... i sure have!use strict; use Data::Dumper; my @wrong = [2,1]; my @right = (2,1); my $ref = [2,1]; print 'right: ', Dumper \@right; print 'right: ', Dumper $ref; print 'wrong: ', Dumper \@wrong;
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Accept array from Form and put in DB
by peppiv (Curate) on Dec 09, 2002 at 16:39 UTC |
In Section
Seekers of Perl Wisdom