From 815e560840114d7c00db50192b825d27406df298 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 11 Aug 2006 07:57:52 +0000 Subject: Localize $_ before magical while(<$file>) loops --- urpm/download.pm | 4 ++++ urpm/ldap.pm | 1 + 2 files changed, 5 insertions(+) (limited to 'urpm') diff --git a/urpm/download.pm b/urpm/download.pm index 909bcb37..e8d92825 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -235,6 +235,7 @@ sub sync_wget { ) . " |"; my $wget_pid = open my($wget), $wget_command; local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!). + local $_; while (<$wget>) { $buf .= $_; if ($_ eq "\r" || $_ eq "\n") { @@ -297,6 +298,7 @@ sub sync_curl { } if (@ftp_files) { my ($cur_ftp_file, %ftp_files_info); + local $_; eval { require Date::Manip }; @@ -376,6 +378,7 @@ sub sync_curl { "--stderr", "-", # redirect everything to stdout @all_files) . " |"; local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!). + local $_; while (<$curl>) { $buf .= $_; if ($_ eq "\r" || $_ eq "\n") { @@ -452,6 +455,7 @@ sub sync_rsync { (defined $options->{'rsync-options'} ? split /\s+/, $options->{'rsync-options'} : ()), "'$file' '$options->{dir}' |"); local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!). + local $_; while (<$rsync>) { $buf .= $_; if ($_ eq "\r" || $_ eq "\n") { diff --git a/urpm/ldap.pm b/urpm/ldap.pm index 34a387d3..e734c883 100644 --- a/urpm/ldap.pm +++ b/urpm/ldap.pm @@ -125,6 +125,7 @@ sub get_ldap_config_file($) { ); # TODO more verbose error ? open my $conffh, $file or return; + local $_; while (<$conffh>) { s/#.*//; s/^\s*//; -- cgit v1.2.1