Hi, I am using diff (GNU diffutils) in a windows XP and perl environment. It does not seems that there is an option to this utility that will write the diff results to an output file from the perl program. I am using the "system" call to invoke the diff utility. Thanks in advance if you can help.
Af
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I am using diff (GNU diffutils) in a windows XP and perl environment. It does not seems that there is an option to this utility that will write the diff results to an output file from the perl program. I am using the "system" call to invoke the diff utility. Thanks in advance if you can help.
Af
Diff always writes output to stdout. You need to use output redirection, if you want to capture its output in a file. The command line syntax is:
diff [-options] f1 f2 > outfile
I don't know perl, so can't say how you do that from within a perl program; perhaps the system function supports that syntax directly, as C's does.
You can find the diff manpage here:
http://man.linuxquestions.org/?query=diff§ion=0&type=2
HTH,
Keith.