aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-01-20 20:08:50 +0000
committerYang Tse <yangsita@gmail.com>2010-01-20 20:08:50 +0000
commit471e8eefb66f6de9a70ddb9dc79bd894374043ec (patch)
treeab7b87e8d3ca9b63d0f2caeb747f50c480fe80f4
parentd2e1ec58f24e4ad50fc669cfd25046afd09c7b85 (diff)
Use delete() to unset environment variables instead of assigning undef which
generates warning 'Use of uninitialized value in scalar assignment' with perl versions older than 5.10
-rwxr-xr-xtests/runtests.pl16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 6dbc7004c..d8a83afb2 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -295,17 +295,17 @@ my $protocol;
foreach $protocol (('ftp', 'http', 'ftps', 'https', 'no')) {
my $proxy = "${protocol}_proxy";
# clear lowercase version
- $ENV{$proxy} = undef if($ENV{$proxy});
+ delete $ENV{$proxy} if($ENV{$proxy});
# clear uppercase version
- $ENV{uc($proxy)} = undef if($ENV{uc($proxy)});
+ delete $ENV{uc($proxy)} if($ENV{uc($proxy)});
}
# make sure we don't get affected by other variables that control our
# behaviour
-$ENV{'SSL_CERT_DIR'} = undef if($ENV{'SSL_CERT_DIR'});
-$ENV{'SSL_CERT_PATH'} = undef if($ENV{'SSL_CERT_PATH'});
-$ENV{'CURL_CA_BUNDLE'} = undef if($ENV{'CURL_CA_BUNDLE'});
+delete $ENV{'SSL_CERT_DIR'} if($ENV{'SSL_CERT_DIR'});
+delete $ENV{'SSL_CERT_PATH'} if($ENV{'SSL_CERT_PATH'});
+delete $ENV{'CURL_CA_BUNDLE'} if($ENV{'CURL_CA_BUNDLE'});
#######################################################################
# Load serverpidfile hash with pidfile names for all possible servers.
@@ -550,7 +550,7 @@ sub torture {
#logmsg "$_ Returned " . $ret >> 8 . "\n";
# Now clear the variable again
- $ENV{'CURL_MEMLIMIT'} = undef if($ENV{'CURL_MEMLIMIT'});
+ delete $ENV{'CURL_MEMLIMIT'} if($ENV{'CURL_MEMLIMIT'});
if(-r "core") {
# there's core file present now!
@@ -2300,7 +2300,7 @@ sub singletest {
$oldenv{$var} = ($ENV{$var})?"$ENV{$var}":'notset';
# set new value
if(!$content) {
- $ENV{$var} = undef if($ENV{$var});
+ delete $ENV{$var} if($ENV{$var});
}
else {
$ENV{$var} = "$content";
@@ -2621,7 +2621,7 @@ sub singletest {
if(%oldenv) {
foreach my $var (keys %oldenv) {
if($oldenv{$var} eq 'notset') {
- $ENV{$var} = undef if($ENV{$var});
+ delete $ENV{$var} if($ENV{$var});
}
else {
$ENV{$var} = "$oldenv{$var}";