Re: Problems Assigning Unique Values to a Hash

2007-06-27 Thread Chas Owens
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

Re: Problems Assigning Unique Values to a Hash

2007-06-27 Thread perl_power
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

Re: Problems Assigning Unique Values to a Hash

2007-06-26 Thread Paul Johnson
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

Re: Problems Assigning Unique Values to a Hash

2007-06-26 Thread Tom Phoenix
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

Problems Assigning Unique Values to a Hash

2007-06-26 Thread campbell262
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

Re: modification on hashes/unique values

2002-12-02 Thread Chris
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

RE: modification on hashes/unique values

2002-12-02 Thread wiggins
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

RE: modification on hashes/unique values

2002-12-02 Thread Beau E. Cox
-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

modification on hashes/unique values

2002-12-02 Thread Ben Crane
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..

RE: Obtaining a slice of unique values from an array

2002-07-01 Thread Shishir K. Singh
: [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

RE: Obtaining a slice of unique values from an array

2002-07-01 Thread Felix Geerinckx
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

Re: Obtaining a slice of unique values from an array

2002-07-01 Thread Sudarsan Raghavan
"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

RE: Obtaining a slice of unique values from an array

2002-07-01 Thread Shishir K. Singh
>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

Re: Obtaining a slice of unique values from an array

2002-06-30 Thread Jeff 'japhy' Pinyan
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

Re: Obtaining a slice of unique values from an array

2002-06-30 Thread Felix Geerinckx
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

Obtaining a slice of unique values from an array

2002-06-30 Thread Dan Fish
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

RE: unique values

2001-11-26 Thread Wagner-David
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)

unique values

2001-11-26 Thread Bart Schelstraete
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