Thanx all for sharing your knowledge.
Suggestion given by CountZero worked. I did same thing. I copied all whole file content into one array and used that array to get no of lines and content of file.
I have still one query. When I used suggestion given by moritz my $count = 0;
while( <$fh> ) { $count++; }
I was unable to get content of file. I think the reason for this was that you cant reuse file handle.
Can anyone tell me why this is so ?
@JavaFan ,
I tried to use this
$content = ` wc -l $Filehandle`
but I could not get output in $count as it should be. This worked fine on command prompt bt not on browser.
Regards,
Prafull