Hi,
Code:
#!/usr/bin/perl
$out = "File";
open FILE, $out or die $!;
while(<FILE>){
if( $_ !=~ /NAME.SRC1.*Running./){
print "$_\n";
}
}
close FILE;
File
Code:
NAME(SRC0) STATUS(Ended normally)
NAME(SRC01) STATUS(Running)
NAME(SRC1) STATUS(Running)
When I execute.
Code:
check.pl
NAME(SRC0) STATUS(Ended normally)
NAME(SRC01) STATUS(Running)
NAME(SRC1) STATUS(Running)
now when I change !=~ to =~
Code:
#!/usr/bin/perl
$out = "File";
open FILE, $out or die $!;
while(<FILE>){
if( $_ =~ /NAME.SRC1.*Running./){
print "$_\n";
}
}
close FILE;
I get this
Code:
check.pl
NAME(SRC1) STATUS(Running)
Which make sense. But the first one !=~ brings a false positive.
Any Ideas?
Thanks