| Summary: | urpmi_rpm-find-leaves won't run unless "my " is removed in " while (my $_ = shift) {" in /usr/bin/urpmi_rpm-find-leaves, line 26 | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Marja Van Waes <marja11> |
| Component: | RPM Packages | Assignee: | Thierry Vignaud <thierry.vignaud> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | liam, thierry.vignaud |
| Version: | Cauldron | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | urpmi-8.111-2.mga7 | CVE: | |
| Status comment: | |||
(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.
Thierry Vignaud
2018-06-13 17:56:54 CEST
Assignee:
mageiatools =>
thierry.vignaud I love perl regressions :-) Fixed in git Resolution:
(none) =>
FIXED |
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