Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Have a sort of trouble.

by linuxer (Deacon)
on Feb 02, 2010 at 20:44 UTC ( #821031=note: print w/ replies, xml ) Need Help??


in reply to Have a sort of trouble.

Hi, $a and $b already contain the file path; if you want to sort by the path, just use them:

What about this?

for my $apache_file ( sort { $a cmp $b } keys( %{ $merge_structure{ ap +ache_log }\ } ) ) { print "$apache_file\n"; }

If you don't want to sort by the file path you should tell us, by what you want to sort.

The file path is the key, you are sorting by the value, whatever that may be...


Comment on Re: Have a sort of trouble.
Select or Download Code
Re^2: Have a sort of trouble.
by dbmathis (Scribe) on Feb 02, 2010 at 20:48 UTC
    Duh, thank you! That's what happens when you don't write perl for a year :)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2015-07-04 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls