in reply to Re^4: partial matching of lines in perlin thread partial matching of lines in perl
Writing to a file is covered in perlintro.