From 2606a0dc070bd05b308410521c0fb4d6012eae62 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 5 Dec 2002 23:23:15 +0000 Subject: parameter passing using $_ is bad --- perl-install/bootloader.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index e2ba67f29..329760a48 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -879,13 +879,14 @@ sub dev2bios { my $start = substr($where, 0, 2); my $translate = sub { - $_ eq $where ? "aaa" : #- if exact match, value it first - /^$start(.*)/ ? "ad$1" : #- if same class (ide/scsi/ultra66), value it before other classes - $_; + my ($dev) = @_; + $dev eq $where ? "aaa" : #- if exact match, value it first + $dev =~ /^$start(.*)/ ? "ad$1" : #- if same class (ide/scsi/ultra66), value it before other classes + $dev; }; @dev = map { $_->[0] } sort { $a->[1] cmp $b->[1] } - map { [ $_, &$translate ] } @dev; + map { [ $_, $translate->($_) ] } @dev; s/x(d.)/h$1/ foreach @dev; #- switch back; -- cgit v1.2.1