go ahead... be a heretic | |
PerlMonks |
Re: Re: Multiple Data Selections per Field in CGIby salvadors (Pilgrim) |
on Jan 29, 2001 at 02:27 UTC ( [id://54904]=note: print w/replies, xml ) | Need Help?? |
If the key exists, then is the value a scalar, or is it an array? If it's the first time the key is encountered, then the value is simply a scalar. The second time the key is encountered, it's still a scalar. The value needs to be converted to an array, and then the new value is added. Each time after that, simply push the new value to the already existing array: You could also do this quite nicely with a tie:
Changing the FETCH method to do what you'd expect is left as an exercise for the reader ;) Tony
In Section
Seekers of Perl Wisdom
|
|