jptxs has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use CGI qw(:standard); use strict; $! = 1; print header; my $try = CGI->new(); my %hash; # tried 'my $hash = {};' too... foreach my $string ( $try->param ) { if ( $string =~ m/(\d+)_(\d+)/ ) { push @{$hash->{$1}->{$2}}, $try->param($string); } } print qq! <HTML><HEAD><TITLE></TITLE></HEAD> <P> then you have:<BR><P>$hash{12}{1} <BODY></BODY></HTML>!;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash name not sticking?
by chromatic (Archbishop) on Sep 05, 2000 at 02:36 UTC | |
by jptxs (Curate) on Sep 05, 2000 at 05:05 UTC | |
|
Re: hash name not sticking?
by ar0n (Priest) on Sep 05, 2000 at 00:45 UTC | |
by jptxs (Curate) on Sep 05, 2000 at 00:50 UTC | |
|
RE (tilly) 1: hash name not sticking?
by tilly (Archbishop) on Sep 05, 2000 at 00:47 UTC | |
by jptxs (Curate) on Sep 05, 2000 at 00:53 UTC | |
|
Re: hash name not sticking?
by agoth (Chaplain) on Sep 05, 2000 at 12:08 UTC |