I have written code to copy contents of one file to another.
It perfectly works fine for the .txt file.
But when I try for .doc file, it doesn't work.
#!/usr/bin/perl use 5.010; use strict; # Open file to read unless (open(DATA1, "file1.doc")) { die "couldn't open file1" }; # Open new file to write unless (open(DATA2, ">>file2.doc")) { die "couldn't open file2" }; # Copy data from one file to another. while(<DATA1>) { print DATA2 "$_\n"; } close( DATA1 ); close( DATA2 );
In reply to Working with word document by nick321
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |