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

I did actually include that line. You mean the same line you mentioned in your code in your first response right ?
I used your code exactly with tweaking few things like file names. The print is showing that its working overall but file output is unfortunately not
btw when I used your suggestion my $ok = $new->toFile($file-name,2) I got I/O invalid argument. I managed to get it work but as I said still doesn't show anything other than what I mentioned.
again thanks for your help

Replies are listed 'Best First'.
Re^5: copy XML elements from one file to another
by Corion (Patriarch) on Nov 26, 2013 at 13:23 UTC

    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.

Re^5: copy XML elements from one file to another
by tangent (Parson) on Nov 26, 2013 at 13:20 UTC
    Please show the code that you have now, it will be easier to debug if we can see it.