Hi,

You can do:

local $/;
open(IN, $file) || die "Can't read $file - $!";
my $content = <IN>;
close IN;

Teddy

----- Original Message ----- 
From: "Anish Kumar K." <[EMAIL PROTECTED]>
To: "beginners perl" <beginners@perl.org>
Sent: Friday, February 11, 2005 8:10 AM
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);

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