Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Have a sort of trouble.

by linuxer (Curate)
on Feb 02, 2010 at 20:44 UTC ( [id://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...

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://821031]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found