in reply to Re: Re: criteria based array sorting
in thread criteria based array sorting

hardburn,
Actually it is a variation on the GRT that tye likes to call The One True Sort. The subtle difference is that you do not have to restore the transformation - you can simply throw it away. An example of a classicle GRT would be:
#!/usr/bin/perl use strict; use warnings; my @needs_sorting = qw(Psdgs ldfgs Esdds aSdg Sgsdfs esdf sgfsdfg Osgr + T); @needs_sorting = map { /^[a-z]/ ? "\u$_" : "\l$_" } sort map { /^[a-z]/ ? "\u$_" : "\l$_" } @needs_sorting; print "$_\n" for @needs_sorting;
Cheers - L~R

Replies are listed 'Best First'.
Re: Re: Re: Re: criteria based array sorting
by jdporter (Paladin) on Feb 13, 2004 at 06:09 UTC
    Actually it is a variation on the GRT that tye likes to call The One True Sort.
    Actually it's not. The One True Sort sorts array indices.
    What we have here is a run-of-the-mill GRT. Which, btw, is a sub-species of the ST. No debate about it. :-)

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.