in reply to magic $a, $b and sort
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: magic $a, $b and sort
by oha (Friar) on Sep 05, 2007 at 15:27 UTC |