silence uninitialized warnings when restoring %ENV
Christian Hansen [Fri, 18 Nov 2005 01:00:52 +0000 (01:00 +0000)]
Changes
lib/HTTP/Request/AsCGI.pm

diff --git a/Changes b/Changes
index af932ab..3b4e73a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for Perl extension HTTP::Request::AsCGI.
 
+0.3  2005-11-18 00:00:00 2005
+    - silence uninitialized warnings when restoring %ENV
+
 0.2  2005-10-31 00:55:00 2005
     - added test for response.
 
index cd7394f..f9ff8a3 100644 (file)
@@ -11,7 +11,7 @@ use IO::File;
 
 __PACKAGE__->mk_accessors(qw[ enviroment request stdin stdout stderr ]);
 
-our $VERSION = 0.2;
+our $VERSION = 0.3;
 
 sub new {
     my $class   = shift;
@@ -212,8 +212,11 @@ sub response {
 
 sub restore {
     my $self = shift;
-
-    %ENV = %{ $self->{restore}->{enviroment} };
+    
+    {
+        no warnings 'uninitialized';
+        %ENV = %{ $self->{restore}->{enviroment} };
+    }
 
     open( STDIN, '>&', $self->{restore}->{stdin} )
       or croak("Can't restore stdin: $!");