Thread STDOUT und ERROUT in Datei umleiten (22 answers)
Opened by Eng1958 at 2013-11-14 12:22

GwenDragon
 2015-03-27 14:42
#180418 #180418
User since
2005-01-17
14540 Artikel
Admin1
[Homepage]
user image
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;          
use warnings;        
use File::Compare;  

my %exclude;
my $file1 = 'default_sysdumpdev_150319.txt';
my $file2 = 'd100spuptl25e0_sysdumpdev.txt';
my $compare = compare('d100spuptl25e0_sysdumpdev.txt', 'default_sysdumpdev_150319.txt');

open my $file, '<', 'default_sysdumpdev_150319.txt' or die $!; 
while (<$file>) {
  chomp;             
  $exclude{$_}++;    $file
}


my $logdatei = 'compare.log';
open my $logfh, '>', $logdatei or die $!;

open $file, '<', 'd100spuptl25e0_sysdumpdev.txt' or die $!;  
while (<$file>) {
  chomp;            
  if($compare == 1){
  print $logfh "False! the files are not equal \n";
 
  print $logfh "$_\n" unless $exclude{$_}; .

  }
  elsif($compare == 0){  
             
  print $logfh "True! the Files are equal \n";
  }
}
close $logfh;
die Drachin, Gwendolyn


Unterschiedliche Perl-Versionen auf Windows (fast wie perlbrew) • Meine Perl-Artikel

View full thread STDOUT und ERROUT in Datei umleiten