in reply to Re^2: Restoring CGI.pm object
in thread Restoring CGI.pm object

If you check the source for CGI, you'll find that those functions read from the ENV vars populated by your webserver.

-Paul

Replies are listed 'Best First'.
Re^4: Restoring CGI.pm object
by Haloric (Novice) on Oct 27, 2008 at 18:07 UTC
    Ah, thats no use to me then. Thanks for pointing that out.

    I will have to use some other way, don't really want to trash my own ENV with values from a previous request.

    Think I will just store a hash of all the ENV values in the original request then, and restore that hash, don't need the $cgi object in that case, since all it does for me is break up the params .

      You can localize changes to the hash...
      sub my_restornator { local %ENV; %ENV = restore_env(); # do things with the restored CGI object # goes back the way it was after this brace: }

      If you're really clever, you could possibly make a restoredCGI object, I'm a little unsure on the details. Can it be done with Autoloader + local? Dunno for sure.

      -Paul