{ local %ENV; # Old %ENV saved away in case you need it # outside this scope. %ENV = ( ...... ); # Create your own custom %ENV. # Most of your script here... } # Here, %ENV will be restored to the original, in case you need # it for something else.