I was using this system and exporting the results to %in so that I could use $in{VAR} in my program.

Which allows me to do

$temp= "BOB";
print "$temp = $in{$temp}<BR>\n";

To my knowledge, which may be lacking considering I just recently started playing with refrences, if I use option 1 or 2 I would have to:

$temp= "BOB";
$bob = $t->get($temp);
print "$temp = $bob<BR>\n";

Is there where way to put the $t->get inside of a "s?

David

From: Joe Schaefer <[EMAIL PROTECTED]>

You have quite a few options here:

  1) Work with the Apache::Request::Table

        $t = $req->param;

and use each(%$t), keys(%$t) and values(%$t) to iterate over the params
in document order (query_string args come first, then the POST
data in the order it was received). To get all entries for a
given parameter, you can use


        @foo_vals = $t->get("foo");

     You can also use $t->do(...) to iterate over the table entries with
     a callback sub.

  2) Think of the $req->param method as a "smart-hash", and use it in
     the same way you'd use CGI::param (since that's the method
     it is patterened after).

  3) Try to stop using the $readquery->Vars API, since $req->param is
     able to decode binary data with embedded '\0' values in them.
     If you can't bring yourself to that, just write your own converter:

    sub Vars {
        my $req = shift;
        map { $_ => join "\0", $req->param($_) } $req->param;
    }


I hope this helps.

--
Joe Schaefer


-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html


_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to