Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 browsing the Monastery: (6)
As of 2014-11-23 21:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls