diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-07-07 07:00:49 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-07-07 07:00:49 +0000 |
commit | 3b78140605cc02f73f50ad6c94bf34f3b6105aae (patch) | |
tree | 011d32635ea55e2d2c87db58f28dcac735177b78 | |
parent | 9b9ffe9d96ec6835461efcb226bbb0bd32ddb053 (diff) | |
download | urpmi-3b78140605cc02f73f50ad6c94bf34f3b6105aae.tar urpmi-3b78140605cc02f73f50ad6c94bf34f3b6105aae.tar.gz urpmi-3b78140605cc02f73f50ad6c94bf34f3b6105aae.tar.bz2 urpmi-3b78140605cc02f73f50ad6c94bf34f3b6105aae.tar.xz urpmi-3b78140605cc02f73f50ad6c94bf34f3b6105aae.zip |
It's better to use lexicals in closures
-rw-r--r-- | urpm.pm | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -2726,7 +2726,6 @@ sub install { } my ($update, @l, %file2pkg) = 0; - local *F; foreach (@$remove) { if ($trans->remove($_)) { @@ -2752,15 +2751,16 @@ sub install { } unless (!$options{nodeps} && (@l = $trans->check(%options)) || !$options{noorder} && (@l = $trans->order)) { + my $fh; #- assume default value for some parameter. $options{delta} ||= 1000; $options{callback_open} ||= sub { my ($data, $type, $id) = @_; - open F, $install->{$id} || $upgrade->{$id} or + open $fh, $install->{$id} || $upgrade->{$id} or $urpm->{error}(N("unable to access rpm file [%s]", $install->{$id} || $upgrade->{$id})); - return fileno F; + return fileno $fh; }; - $options{callback_close} ||= sub { close F }; + $options{callback_close} ||= sub { close $fh }; if (keys %$install || keys %$upgrade) { $options{callback_inst} ||= \&install_logger; $options{callback_trans} ||= \&install_logger; |