The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.perl.misc
From: gba...@itsc.uah.edu (Greg Bacon)
Date: 1999/05/28
Subject: Re: Incrementing a value in a slice
In article <x7emk1i36u....@home.sysarch.com>,
Uri Guttman <u...@sysarch.com> writes: : >>>>> "GB" == Greg Bacon <gba...@itsc.uah.edu> writes: : GB> my @uniq; : GB> my %seen; : : GB> while (<>) { : GB> chomp; : : GB> push @uniq, $_ unless $seen{$_}++; : GB> } : : GB> my $mode = shift @uniq; : GB> for (@uniq) { : GB> $mode = $_ if $seen{$_} > $seen{$mode}; : GB> } : : greg, you can do better than that! why two loops? why the push into : @uniq? It's a pedagogical issue. I wanted to show how to collect the Greg You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
|