Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Have a sort of trouble.

by linuxer (Curate)
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
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?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-11-26 01:05 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (695 votes), past polls