Some time ago, ankh reported on IRC that urpmi_rpm-find-leaves won't run. # urpmi_rpm-find-leaves Can't use global $_ in "my" at /usr/bin/urpmi_rpm-find-leaves line 26, near "my $_ " Execution of /usr/bin/urpmi_rpm-find-leaves aborted due to compilation errors I can confirm that, like he said, removing "my " in " while (my $_ = shift) {" in /usr/bin/urpmi_rpm-find-leaves solves the issue. Git blame told me that "my " was added to that line in this commit http://gitweb.mageia.org/software/rpm/urpmi/commit/?id=6aaf7d1e438b9820164b94d3b548a858bb6abf68 -while ($_ = shift) { +while (my $_ = shift) { It didn't tell me whether that change should be reverted, or that another solution is better :-p
(In reply to Marja Van Waes from comment #0) > > http://gitweb.mageia.org/software/rpm/urpmi/commit/ > ?id=6aaf7d1e438b9820164b94d3b548a858bb6abf68 > > -while ($_ = shift) { > +while (my $_ = shift) { > > It didn't tell me whether that change should be reverted, or that another > solution is better :-p I now think the above commit was exactly as intended. However, "my $_" is no longer allowed in Perl, even if it was since Perl 5.10: https://rt.cpan.org/Public/Bug/Display.html?id=108203
Using $_ as a variable name is completely unhelpful to understand what the variable contains/is.
Assignee: mageiatools => thierry.vignaudStatus: NEW => ASSIGNED
I love perl regressions :-)
Fixed in git
Resolution: (none) => FIXEDStatus: ASSIGNED => RESOLVED