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:42 PM


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

Oh, maybe like this then:


Code
for my $x ( sortit() ) {  
unless ( $seen{$x->[1]} ) {
print "$x->[0]\t$x->[1]\n";
$seen{$x->[1]}++;
}
else {
print STDERR "Oh noes! Duplicate: $x->[0] $x->[1]\n";
die;
}
}



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


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