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 it is a
scalar. When you do a
%people = <INPUT>
you filehandle operator is evaluated in a list context, i.e. all the lines
in your file are read in at once.
When your filehandle operator is evaluated in a scalar context only the
next line is read in.
> ****************************************************************************
> ****************************
> #! /usr/bin/perl -w
>
> open (INPUT, "<people.data");
Forgot to mention in my reply to the OP too, when you open a file you
should always check for failure.
open (INPUT, "<people.data") or die "Failed to open people.data: $!\n";
> $people = <INPUT>;
At this point $people contains 'jose 2'. When you say you removed 'jose'
from the print line do you mean from the file itself, I am sorry you are
not allowed to do that.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]