M
monkeys paw
For some reason i'm forced to use a scalar for
ONE hash element and not the rest. Here is how the
code behaves:
This works:
$qry = new CGI;
foreach (@names) {
if ($_ =~ /^newsummary(.*)$/ && $qry->param($_)) {
# I have no clue why 'id' must be a scalar to work. [sf]
my $id = $qry->param('id' . $1);
%hash = (
file_name => $qry->param('file_name' . $1),
id => $id,
comment_name => $qry->param('newsum_name' . $1),
id_type => 'bill',
commentary => $qry->param($_),
);
}
}
At his point the hash looks like:
file_name => 'file',
id => 'CA2005',
comment_name => 'cname',
id_type => 'bill',
commentary => 'some comment',
However, if i use $qry for 'id' the hash gets whacked like
so:
%hash = (
file_name => $qry->param('file_name' . $1),
id => $qry->param('id' . $1),
comment_name => $qry->param('newsum_name' . $1),
id_type => 'bill',
commentary => $qry->param($_),
);
CA2005 => undef,
file_name => 'file',
id => 'CA2005',
comment_name => 'cname',
id_type => 'bill',
commentary => 'some comment',
ONE hash element and not the rest. Here is how the
code behaves:
This works:
$qry = new CGI;
foreach (@names) {
if ($_ =~ /^newsummary(.*)$/ && $qry->param($_)) {
# I have no clue why 'id' must be a scalar to work. [sf]
my $id = $qry->param('id' . $1);
%hash = (
file_name => $qry->param('file_name' . $1),
id => $id,
comment_name => $qry->param('newsum_name' . $1),
id_type => 'bill',
commentary => $qry->param($_),
);
}
}
At his point the hash looks like:
file_name => 'file',
id => 'CA2005',
comment_name => 'cname',
id_type => 'bill',
commentary => 'some comment',
However, if i use $qry for 'id' the hash gets whacked like
so:
%hash = (
file_name => $qry->param('file_name' . $1),
id => $qry->param('id' . $1),
comment_name => $qry->param('newsum_name' . $1),
id_type => 'bill',
commentary => $qry->param($_),
);
CA2005 => undef,
file_name => 'file',
id => 'CA2005',
comment_name => 'cname',
id_type => 'bill',
commentary => 'some comment',