in reply to question about: my $a AND sort {$a <=> $b} keys %hash
"my $a" used in sort comparison at ./1.pl line 7.
That's why you should never use $a and $b as variable names. sort needs access to the package variable $a (documented at $a).
Update: link to perlvar added.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: question about: my $a AND sort {$a <=> $b} keys %hash ($::a & $::b)
by BrowserUk (Patriarch) on Aug 06, 2015 at 21:04 UTC | |
by choroba (Cardinal) on Aug 06, 2015 at 21:44 UTC | |
by BrowserUk (Patriarch) on Aug 06, 2015 at 22:03 UTC | |
|
Re^2: question about: my $a AND sort {$a <=> $b} keys %hash
by rsFalse (Chaplain) on Aug 06, 2015 at 09:19 UTC | |
by CountZero (Bishop) on Aug 06, 2015 at 10:27 UTC |