open $templatefile; $newfilecontent= &parse($templatefile, \@replacements); open $newfile; print ($newfile, $newfilecontent);