Jul 14, 2014, 10:44 PM
Post #1 of 3
Not able to read the file into string
I am trying to read a file and appending it to another file.
Modify the another file and return the content as string.
my($t,$fname) = @_;
open (my $DATA1, "<$fname");
open (my $DATA2, ">>file2.txt");
while(my $line = <$DATA1>)
if($line =~ /^ovm_report/)
print $DATA2 $line;
$t .= <DATA2>;
print "COOL_CAKE \n $t";
This code is returning the first file content but not the second file