----- Original Message -----
From: "Casey West" <[EMAIL PROTECTED]>
To: "Yacketta, Ronald" <[EMAIL PROTECTED]>
Cc: "Beginners (E-mail)" <[EMAIL PROTECTED]>

>   open FILE, "filename" or die $!;
>   my $line = <FILE>;
>   close FILE;
>
> Remember, <FILEHANDLE> is something you can iterate over.  In scalar
> context it returns just one line (for all intents and purposes) at a
> time.

Am I right to say that although $line reads the first line, the whole file
is still being read till the end of file.

If I am sitting for a test, I failed because I would probably think that
$line = <FILE> would read the last line, I say so because of the following
reasons:-

my @line =<FILEHANDLE>; reads every line into @line, therefore I see the
'read FILEHANDLE' just like an array of lines like this :-
<FILEHANDLE> equivalent to ('line 1\n' , 'line2\n' ..... and so on.. ) and
if this is so, therefore $line should read the last line like this example
:-

my $line = ( 'line1', 'line2' , 'line3' );
print $line; # print line3

Thanks.





_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to