... { open my $rh, "./read_file" or die $!; open my $wh, ">> ./write_file" or die $!; print $wh $_ while <$rh> } ...