in reply to Re^4: copy XML elements from one file to another
in thread copy XML elements from one file to another

Note that $file-name is not a valid variable name in Perl. I recommend that you start using the strict pragma in your program, which will catch such mistakes.