perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Chapman <scott_l...@mischko.com>
Subject Trying to put a hash in $req.
Date Fri, 17 Jan 2003 00:07:02 GMT
I'm trying to parse the ENV{QUERY_STRING} and put it in a hash (%fields) in 
$req.  This is being done in constants.epl under EmbPerl::Object.  I want to 
make this hash available to the page being loaded without having to go 
through too much trouble and I don't want to use cookies.  I'm doing this to 
parse and build the %fields hash in $req.  Am I doing this right?

$queryString = $ENV{QUERY_STRING};
@queries = split(/&/, $queryString);
for ($i = 0; $i < @queries; $i ++) {
  @pairs = split(/=/, $queries[$i]);
  $value = $pairs[1];
  do decode(*value);
  $req->{$fields{$pairs[0]}} = $value;
}


Later when I try to walk through the hash it doesn't work and I'm accessing it 
wrong I think:

while(($key, $value) = each($req->{%fields})) {
&{$req->{DBUG}} ("FIELDS: KEY: $key   VALUE: $value");
}

I'm not too strong on this "$req->" stuff.  If anyone can give me a boost here 
I'd appreciate it!

Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message