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

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 .

Replies are listed 'Best First'.
Re^5: Restoring CGI.pm object
by jettero (Monsignor) on Oct 27, 2008 at 19:43 UTC
    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