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:53 AM
Subject: Re: open file into hash


> <[EMAIL PROTECTED]> 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, "<people.data");
>
> > %people = <INPUT>;
> ^^^^^^^^^^^^^^^^^^^^
> Not what you want.
>
> foreach (<INPUT>) {
> ($key, $var) = split(/\s+/, $_);
> $hash{$key} = $var;
> }
>
> Or similar.
>
> Tor
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to