badrinath chitrala <[EMAIL PROTECTED]> asked:
> open FILE, "file.txt" or die $!;
> while (<f:/file.txt>)
> 
> Sombody please tell me why do i get the message as below if i 
> want to print the contents of text file

I would suggest you use the three argument open, i.e.

        OPEN FILE, '<', $file or die "Can't open '$file': $!";

and then use the filehandle and not the filename with the
diamond operator, i.e.

        print while( <FILE> );

HTH,
Thomas



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to