-----Original Message-----
From:   Anish Kumar K. [mailto:[EMAIL PROTECTED]
Sent:   Fri 2/11/2005 11:40 AM
To:     beginners perl
Cc:     
Subject:        IS there any way to get rthe content of the file
Hi 

I wanted to read the content of file in one varaible. Now I am doing

open INPUT, "a.txt" | die "Cannot open the file";

while (<INPUT>)
{
   $temp=$temp.$_;
}

print "the entire file is $temp";
close(INPUT);

Change the line no. 1 to 
open INPUT, "a.txt" || die "Cannot open the file";

It should work.


I wanted to get the entire varaible I tried with other way but failed

Anish





--
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