Hi, everybody!
I need to remove the elements of list number 2 from list number 1. Can somebody please tell why this doesn't work:
$outputFile = "C:\\Documents and Settings\\a\\Desktop\\Output.doc";
unlink ( $outputFile );
while ( -e $outputFile ) {}
open ( LIST1, "<", "D:\\ATLinks.doc" );
@list1 = <LIST1>;
close ( LIST1 );
$list1 = "@list1";
open ( LIST2, "<", "D:\\ATLog1.doc" );
@list2 = <LIST2>;
close ( LIST2 );
chomp ( @list2 );
for ( @list2 ) {
$list1 =~ s/$_//gms;
}
open ( FIL, ">>", $outputFile );
print FIL $list1;
close ( FIL );
I need to remove the elements of list number 2 from list number 1. Can somebody please tell why this doesn't work:
$outputFile = "C:\\Documents and Settings\\a\\Desktop\\Output.doc";
unlink ( $outputFile );
while ( -e $outputFile ) {}
open ( LIST1, "<", "D:\\ATLinks.doc" );
@list1 = <LIST1>;
close ( LIST1 );
$list1 = "@list1";
open ( LIST2, "<", "D:\\ATLog1.doc" );
@list2 = <LIST2>;
close ( LIST2 );
chomp ( @list2 );
for ( @list2 ) {
$list1 =~ s/$_//gms;
}
open ( FIL, ">>", $outputFile );
print FIL $list1;
close ( FIL );