Which version of perl are you using? I tested it with 5.8.4 and 5.8.8, both on Linux.#!/usr/bin/perl #use strict; #use warnings; #use diagnostics; my $a; my @array = sort { $a <=> $b } 19, 28, 1 .. 3; print "@array\n"; __END__ Can't use "my $a" in sort comparison at oha2.pl line 7
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
In reply to Re: magic $a, $b and sort
by polettix
in thread magic $a, $b and sort
by oha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |