develooper Front page | perl.beginners | Postings from April 2002

Re: Array question

Thread Previous | Thread Next
From:
ERIC Lawson - x52010
Date:
April 1, 2002 11:37
Subject:
Re: Array question
Message ID:
Pine.LNX.4.21.0204011134570.1333-100000@arwen.bioeng.washington.edu
Sorry, there were a couple typos in my earlier response:

> %count = ();
> foreach $element (@array1) { $count{$element}++ }

I should've included the semicolon at the end of the second line.

> Your array of unique names is now available from the keys of %count;
> the number of occurences of each unique name is available as the value
> of %count{$name}.

The "%count{$name}" above should be $count{$name}.

> best,
> Eric

not best,
Eric

-- 

James Eric Lawson
Research Publications Editor
National Simulation Resource

eric@bioeng.washington.edu

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

Whereof one cannot speak, thereof one must be silent. -- Wittgenstein


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About