Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How do you specify which fields to sort by when sorting an array.

by tadman (Prior)
on Jul 15, 2002 at 04:37 UTC ( [id://181695]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @output = sort { $a->[0] cmp $b->[0]
                     || $a->[3] <=> $b->[3] }
                 map { chomp; [ split(',', $_, 4) ] }
                 <INPUT_FILE>;
    
  2. or download this
    sub phone_value
    {
         my ($v) = @_;
    ...
                     || phone_value($a->[3]) <=> phone_value($b->[3]) }
                 map { chomp; [ split(',', $_, 4) ] }
                 <INPUT_FILE>;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://181695]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-25 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found