Re: question about sort()
mazzawi_at_gmail.com
Date: 03/08/05
- Previous message: Bill Corden: "New to Perl"
- In reply to: Jim Gibson: "Re: question about sort()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 8 Mar 2005 12:35:19 -0800
it returns a sorted array, it doesn't modify the source
#!/usr/bin/perl -w
use strict;
my @L=(35,10,0,27,100,-4);
sub numeric { $a <=> $b; }
@L = sort numeric @L;
print @L;
- Previous message: Bill Corden: "New to Perl"
- In reply to: Jim Gibson: "Re: question about sort()"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]