Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Sorting a "tuple" by the second value

by Anonymous Monk
on Apr 09, 2012 at 08:13 UTC ( #964099=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Sorting a "tuple" by the second value
in thread Sorting a "tuple" by the second value

I've never used the @$blah variable type before, and I couldn't find any information about it. I'm guessing that's how you refer to the arrays in an array of arrays?

Yes, that is one way to do it, known as dereferenceing because $blah is a reference, see references quick reference

Its nice you picked up a new trick, but I would still use sort :)

$ cat fafafile 3 6 1 1 2 0 9 1 9 4 4 5 7 3 2 0 5 4 6 7 6 2 9 8 $ sort --dictionary-order fafafile 0 5 4 1 2 0 2 9 8 3 6 1 4 4 5 6 7 6 7 3 2 9 1 9 $ sort --dictionary-order --key=2,2 fafafile 9 1 9 1 2 0 7 3 2 4 4 5 0 5 4 3 6 1 6 7 6 2 9 8


Comment on Re^3: Sorting a "tuple" by the second value
Re^4: Sorting a "tuple" by the second value
by thmsdrew (Scribe) on Apr 09, 2012 at 18:00 UTC

    Wow, that is a lot easier than my way. It takes longer but I also had to take the time to write the program in the first place! Thank you kind sir!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-07-10 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (204 votes), past polls