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: Beginner: Re: [spuds] Manipulating a Hash with keys that have more than one value: Edit Log



Karazam
User

Mar 12, 2011, 3:30 PM


Views: 6445
Re: [spuds] Manipulating a Hash with keys that have more than one value

You mean like this situation?


Code
aRule	rulenumber=1 
bRule rulenumber=2
cRule rulenumber=3
dRule rulenumber=3


If so, what would you want the output to be in that case?

Edit: If you simply want to skip the dRule line, then this modification might be what you need.


Code
for my $x ( sortit() ) {  
print "$x->[0]\t$x->[1]\n" unless $seen{$x->[1]};
$seen{$x->[1]}++;
}



(This post was edited by Karazam on Mar 12, 2011, 3:38 PM)


Edit Log:
Post edited by Karazam (User) on Mar 12, 2011, 3:38 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