That is because the file
result_file.txt is still opened for writing and the content has not yet been written physically (flushed) when you are opening it again for reading.
While you can force flushing using
$fh1->flush()
, a better solution is closing file handles when not needed anymore:
close($fh1);
close($fh);
if(open( my $fh2, '<', "result_file.txt" ) || die( $! ))
{
while ( my $row = <$fh2> ) {
chomp $row;
print "****$row****";
}
close($fh2);
}