CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [stuckinarut] Extracting duplicates and ordering by occurences: Edit Log



Laurent_R
Veteran / Moderator

Jul 27, 2014, 3:09 PM


Views: 7554
Re: [stuckinarut] Extracting duplicates and ordering by occurences

Just picked up another problem I did not see at first glance:


Code
     if value ( %{ $C_list{$_} } >1 ) {

I would be surprised if that even compiles.

What you want is probably something like this:

Code
foreach my $value (sort {$C_list{$b} <=> $C_list{$a} } keys %C_list) {  
if ($value > 1) {
print "$value $C_list{$value} ";
print "$C_list{$_} \n";
}
}



(This post was edited by Laurent_R on Jul 27, 2014, 3:10 PM)


Edit Log:
Post edited by Laurent_R (Veteran) on Jul 27, 2014, 3:10 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives