Re: open file into hash

2002-08-19 Thread John W. Krahn
Wagner wrote: > > Hi, Hello, > Though this thread is now almost a week old, I thought I'd offer one more > suggestion. How about using this > > %people = map { chomp; split } ; > > in place of > > %people = ; > > To my eyes, it is cleaner than adding an explicit loop. The chom

RE: open file into hash

2002-08-19 Thread Wagner Jeff Civ Northrop Grumman/TTMS
From: Jose Malacara [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 14, 2002 2:35 AM To: Perl beginners Subject: open file into hash Hello. I was wondering if there was a way to open a file into a hash? I know this works for arrays, but was wondering if I this could be done for a hash also. I h

Re: open file into hash

2002-08-14 Thread John W. Krahn
Jose Malacara wrote: > > Hello. I was wondering if there was a way to open a file into a hash? I know > this works for arrays, but was wondering if I this could be done for a hash > also. > > I have a file called people.data, which contains two colums: > jose2 > karen 8 > j

Re: open file into hash

2002-08-14 Thread Jose Malacara
Thanks to all who replied with the useful advice. I really appreciate the help. Thanks! Jose - Original Message - From: "Tor Hildrum" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Perl" <[EMAIL PROTECTED]> Sent: Wednesday, August 14, 2002 3:

Re: open file into hash

2002-08-14 Thread Sudarshan Raghavan
On Wed, 14 Aug 2002, Andy Anderson wrote: > Hi: > > By first changing the % sign to a $ sign and then removing {jose} in the > print line I got it to work. I tested it in both Windows and Linux > environments with the same results. The % specifies that the identifier is a hash and the $ means i

Re: open file into hash

2002-08-14 Thread Andy Anderson
se Malacara" <[EMAIL PROTECTED]> To: "Perl beginners" <[EMAIL PROTECTED]> Sent: Wednesday, August 14, 2002 12:35 AM Subject: open file into hash Hello. I was wondering if there was a way to open a file into a hash? I know this works for arrays, but was wondering if I thi

Re: open file into hash

2002-08-14 Thread Felix Geerinckx
on Wed, 14 Aug 2002 07:35:29 GMT, [EMAIL PROTECTED] (Jose Malacara) wrote: > I have a file called people.data, which contains two colums: > jose 2 > karen 8 > jason 9 > tracey 1 > Can someone tell me what I am doing wrong here: > #! /usr/bin/perl -w > open (INPUT,

Re: open file into hash

2002-08-14 Thread Sudarshan Raghavan
On Wed, 14 Aug 2002, Jose Malacara wrote: > Hello. I was wondering if there was a way to open a file into a hash? I know > this works for arrays, but was wondering if I this could be done for a hash > also. > > I have a file called people.data, which contains two colums: > jose 2 > ka

Re: open file into hash

2002-08-14 Thread Tor Hildrum
<[EMAIL PROTECTED]> wrote: > I have a file called people.data, which contains two colums: > jose2 > karen8 > jason9 > tracey1 > > > Can someone tell me what I am doing wrong here: > = > #! /usr/bin/perl -w > > open (INPUT,

open file into hash

2002-08-14 Thread Jose Malacara
Hello. I was wondering if there was a way to open a file into a hash? I know this works for arrays, but was wondering if I this could be done for a hash also. I have a file called people.data, which contains two colums: jose2 karen 8 jason 9 tracey 1 Can someo