Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Sort - can't

by chas (Priest)
on Aug 29, 2005 at 01:36 UTC ( #487321=note: print w/ replies, xml ) Need Help??


in reply to Re: Sort - can't
in thread Sort - can't

"($sub1, $sub2, $sub3) = split (/\_/, @array,3); $sub3 = sort { $b <=> $a } $sub3;"

It isn't clear to me what your array is exactly, but in any case, as has been remarked already, $sub3 will be a single string, and sorting it will have no effect. It isn't clear to me what you want to do or I would have offered more suggestions.
chas
(Update: Actually, what I said is misleading. I *think* the first line of the code above will take @array in scalar context giving the number of elements, and then $sub1 will be this value; $sub2 and $sub3 will be empty. The sorting will do nothing useful, of course. So perhaps you should just ignore my reply above and read the other replies...)


Comment on Re^2: Sort - can't
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (17)
As of 2014-10-21 12:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (103 votes), past polls