in reply to sorting with Schwartzian Transform

To request I try to specify more data - as sample.
each element in array is in fact another array so there should be sometnig like:
name;password;phonenumber;price

with real datas something like this:
LTOW;mypass;+420-2-312456;1.125.369,25

I know (it is somewhere specify) that in phonenumber are only phonenumber in format like this one. When I want sort element in @array by phone number I must first convert number into number only format - remove + and - marks. Than I will be able to use <=> operator. But results should be @array with original phone numbers. Price field is the same problem - at first I must convert into numeric only and then I can sort.....

Li Tin O've Weedle
mad Tsort's philosopher

Replies are listed 'Best First'.
Re: Re: sorting with Schwartzian Transform
by no_slogan (Deacon) on May 08, 2001 at 03:32 UTC
    Any particular reason why telephone numbers need to be compared as numbers and not as strings? If you need to make more transformations, just keep chewing on $key in the map statement.
    map { my $key = (split /,/, $_)[$idx]; chomp $key; $key =~ s/[-+]//g; # and so on... [ $_, $key ] } @array;
      Yeah no good example, prices is better.
      Many THX fot your answer....

      Li Tin O've Weedle
      mad Tsort's philosopher