in reply to Perl script to find particular string and save those lines in another file?
You have to open your NEW file before you print into it.