From a6df7f2c386bf2d46c41bdc0e15e699753037819 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 7 Nov 2006 08:54:36 +0000 Subject: use $s instead of $_, it's cleaner and same speed --- urpmf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'urpmf') diff --git a/urpmf b/urpmf index 55848de5..25dbeae1 100755 --- a/urpmf +++ b/urpmf @@ -146,10 +146,10 @@ my $sprintfargs = join(', ', map { my $next_st = $multi ? 'next' : 'return 1'; my @inner = ( - "\$_ = sprintf(qq{$proto\\n}, $sprintfargs);", - "$expr or $next_st;", - $uniq ? ('$uniq{$_} and ' . $next_st . ';', '$uniq{$_} = 1;') : (), - "print;", + "my \$s = sprintf(qq{$proto\\n}, $sprintfargs);", + "\$s =~ $expr or $next_st;", + $uniq ? ('$uniq{$s} and ' . $next_st . ';', '$uniq{$s} = 1;') : (), + 'print $s;', ); if ($multi) { @@ -160,12 +160,10 @@ if ($multi) { ); } -#- it would be nice to use "my $_" in this callback. my $callback = join("\n", "sub {", (map { " $_" } 'my ($urpm, $pkg) = @_;', - 'local *_;', @inner, '1;'), "}"); -- cgit v1.2.1