Re: Accessing form mutiples

2004-07-30 Thread Dermot Paikkos
Hi, It's late and I shouldn't even be in the office but thanx for the replies. The point that you can't have hash keys of the same name makes a huge amount of sense and is something is mentioned about it in the cookbook. I'll try the slice on Monday, as two replies are stating that as the sol

Re: Accessing form mutiples

2004-07-30 Thread Jeremy Brooks
I'm a modperl newbie but a pretty good Perl programmer. My first thought is that you can't have multiple hash keys with the same name. That's why you can only see one key called 'on'. Maybe the 'on' value that you are seeing is an array or array reference? I hope I'm not way off base here but thi

Re: Accessing form mutiples

2004-07-30 Thread Thomas Schindl
[...] As already stated by Joe you have two possibilities: 1. Use Hashslice-Sytanx (very short hand) my %hash = (); foreach( $r->param() ) { @hash{$r->param($_)} = ( 1 ); } 2. For a more verbose version you should use a inner foreach: my %hash = (); foreach( $r->param() ) { foreach( $r-

Re: Accessing form mutiples

2004-07-30 Thread Dermot Paikkos
Does that explain, if I use the version of junk.pm below, with this uri: http://dev.sciencephoto.co.uk/junk?no=1&no=2&no=3 I get: $r->no = 1 user = 1 user = 2 user = 3 and http://dev.sciencephoto.co.uk/junk?one=1&two=2&three=3 gives: $r->one = 1 $r->two = 2 $r->three = 3 user = 1 user = 2 use

Re: Accessing form mutiples

2004-07-30 Thread Joe Schaefer
"Dermot Paikkos" <[EMAIL PROTECTED]> writes: [...] > foreach my $param ($r->param) { > print STDERR "\$r->$param = ".scalar($r->param($param))."\n"; > # $hash_ref->{$r->param($param)} = 0; Have you tried using a slice there? @{$hash_ref}{$r->param($param)} = (); # valu

Re: Accessing form mutiples

2004-07-30 Thread Michael
Dermot Paikkos wrote: Hi modperls, Apache/1.3.26 (Unix) mod_perl/1.27 I have started getting odd results from requests that come from forms with multiple options. If I pass the following uri all is well: http://server.com/junk?one=1&two=2&three=3 But this doesn't http://server.com/junk?no=1&no=2