Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm a perl beginner and can't see why this sort doesn't work:
The array @vfs is an array of $vf objects which have a numerical property called start. When i loop around the @sorted_vfs array the $vf objects are not in numerical order. thanks a lotmy @sorted_vfs = sort { $a->start() <=> $b->start() } @vfs; foreach my $vf (@sorted_vfs){ print $vf->start(), "\n"; }#end for each
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: why doesn't this sort work?
by GrandFather (Saint) on Dec 28, 2010 at 00:53 UTC | |
|
Re: why doesn't this sort work?
by Marshall (Canon) on Dec 28, 2010 at 00:49 UTC | |
|
Re: why doesn't this sort work?
by Anonymous Monk on Dec 28, 2010 at 00:39 UTC | |
by Anonymous Monk on Dec 28, 2010 at 00:50 UTC | |
by Anonymous Monk on Dec 28, 2010 at 01:00 UTC |