Hi.. I have written a perl script for displaying the difference between two directory structures.(inc luding the diffferences in the files)
I have to generate the output in a log file.
[CODE=perl]
#!usr/local/bin/perl -w
use Test::More tests => 5;
use Test::Files;
use File::Spec;
my $logging = "file";
if ($logging eq "file") {
open LOG, ">output.lo g" or die $!;
select LOG;
}
print "\nEnter the first folder name\n";
my $dir1 = <STDIN>;
chomp($dir1);
print "\nEnter the second folder name\n";
my $dir2 = <STDIN>;
chomp($dir2);
compare_dirs_ok ($dir1,$dir2,"R EPORT1");
compare_dirs_ok ($dir2,$dir1,"R EPORT2");
select STDOUT;
[/CODE]
I have tried changing the FileHandle to LOG file. But its not working in the function compare_dirs_ok ()
can any1 suggest something for generating the output in a log file instead of standard output.
I have to generate the output in a log file.
[CODE=perl]
#!usr/local/bin/perl -w
use Test::More tests => 5;
use Test::Files;
use File::Spec;
my $logging = "file";
if ($logging eq "file") {
open LOG, ">output.lo g" or die $!;
select LOG;
}
print "\nEnter the first folder name\n";
my $dir1 = <STDIN>;
chomp($dir1);
print "\nEnter the second folder name\n";
my $dir2 = <STDIN>;
chomp($dir2);
compare_dirs_ok ($dir1,$dir2,"R EPORT1");
compare_dirs_ok ($dir2,$dir1,"R EPORT2");
select STDOUT;
[/CODE]
I have tried changing the FileHandle to LOG file. But its not working in the function compare_dirs_ok ()
can any1 suggest something for generating the output in a log file instead of standard output.
Comment