On 6/27/07, perl_power <[EMAIL PROTECTED]> wrote:
Tom,
I did make some changes but that actually is still causing me to
output each line while looping through the file instead of only adding
unique key value pairs to the hash. I can only guess I am overriding
the hash each time it loops? Also
Tom,
I did make some changes but that actually is still causing me to
output each line while looping through the file instead of only adding
unique key value pairs to the hash. I can only guess I am overriding
the hash each time it loops? Also don't understand the line break I
am getting between
On Tue, Jun 26, 2007 at 03:48:21PM -0700, Tom Phoenix wrote:
> Does that get you closer to your goal? Good luck with it!
Also, you are splitting on | when the data suggests you should split on
whitespace.
--
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net
--
To unsubscribe, e-mail: [EMAI
On 6/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
open(FILE, "
So the input is called something ".out"? Okay, if you must, but you
should check the result of open with "or die".
my(%hash)=undef;
And you should probably add "use strict" and "use warnings", to catch
things like this. T
I have a input file with thousands of lines in it. I use this input
file to produce multiply reports, one of which I only want to output
the unique product names.
For the sake of this forum I have shortened the input file from 2
elements down from 9, and only am concentrating on how to deal with
The definition of a hash requires that all keys are unique. To use a
hash the way you want, you may need to make the value for the key
"Acorn Drive" a pointer to an array containing the data you intend [A,
B, ...]. You can use an "anonymous" array to hold the data you want.
(This is what the
If I understand correctly what you are trying to do can't be done with "normal"
hashes. Normally a hash can contain only one value for each unique key, and therefore
you overwrite the value each time you assign a value to a particular key. So you have
two obvious options (in other words that I
-Original Message-
From: Ben Crane [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 4:39 AM
To: [EMAIL PROTECTED]
Subject: modification on hashes/unique values
Hi,
a slight change to the previous mail: if I've got a
key (e.g. A, and I have 3 or 4 keys (which are all A)
which corres
Hi,
a slight change to the previous mail: if I've got a
key (e.g. A, and I have 3 or 4 keys (which are all A)
which correspond to different data...
e.g. Acorn Drive is a key, but there are several parts
the make up Acorn Drive...I want a key (Acorn drive)
to be able to refer to EVERY part of it..
: [EMAIL PROTECTED]
Subject: RE: Obtaining a slice of unique values from an array
on Mon, 01 Jul 2002 13:45:30 GMT, [EMAIL PROTECTED] (Shishir
K. Singh) wrote:
> This is the example "d" cited in perldoc -q duplicate
> d) A way to do (b) without any loops or greps:
[line numbers add
on Mon, 01 Jul 2002 13:45:30 GMT, [EMAIL PROTECTED] (Shishir
K. Singh) wrote:
> This is the example "d" cited in perldoc -q duplicate
> d) A way to do (b) without any loops or greps:
[line numbers added for reference]
> 01undef %saw;
> 02@saw{@in} = ();
> 03@out = sor
"Shishir K. Singh" wrote:
> >on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote:
>
> > What is the most efficient (or at least AN efficient :-) way of
> > obtaining a slice from an array wherein the slice contains only
> > unique values found in the array?
&g
>on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote:
> What is the most efficient (or at least AN efficient :-) way of
> obtaining a slice from an array wherein the slice contains only
> unique values found in the array?
>See
> perldoc -q duplicate
--
>felix
This is
On Jun 30, Dan Fish said:
>What is the most efficient (or at least AN efficient :-) way of obtaining a
>slice from an array wherein the slice contains only unique values found in
>the array?
>if @array = (1,3,5,5,3,5,2,1) then @slice = (1,3,5,2)
This is FAQ.
perldoc -q unique
on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote:
> What is the most efficient (or at least AN efficient :-) way of
> obtaining a slice from an array wherein the slice contains only
> unique values found in the array?
See
perldoc -q duplicate
--
felix
--
To unsubscrib
What is the most efficient (or at least AN efficient :-) way of obtaining a
slice from an array wherein the slice contains only unique values found in
the array?
I.E.
if @array = (1,3,5,5,3,5,2,1) then @slice = (1,3,5,2)
Thanks,
-Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
te [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 26, 2001 23:03
To: [EMAIL PROTECTED]
Subject: unique values
Hello beginners-list,
Do somewhone know how to cut unique values from a list - ignoring the
case (if possible) - with perl?
For example:
@list=(word1,word2,word1,WORD1,word3)
Hello beginners-list,
Do somewhone know how to cut unique values from a list - ignoring the
case (if possible) - with perl?
For example:
@list=(word1,word2,word1,WORD1,word3)
and this must result in => (word1,word2,word3)
Best regards,
Bart mai
18 matches
Mail list logo