D
Domenico Discepola
Hello. I cannot match $ex in the following example. I'm reading records
from a text file (field seperator "\n" record seperator "\x0c"). I
simulated 1 incoming record in the $a variable. Unfortunately, I wasn't
able to get any insight from perldoc... Any help would be appreciated.
#!perl
use strict;
use warnings;
my $ex = '$Conflict: ';
my $a = "field1: test1\n\$Conflict: 1\nfield 3: test3\x0c";
print "[$a]\n";
if ( $a =~ /$ex/ ) {
print "found\n";
} else {
print "not found\n";
}
from a text file (field seperator "\n" record seperator "\x0c"). I
simulated 1 incoming record in the $a variable. Unfortunately, I wasn't
able to get any insight from perldoc... Any help would be appreciated.
#!perl
use strict;
use warnings;
my $ex = '$Conflict: ';
my $a = "field1: test1\n\$Conflict: 1\nfield 3: test3\x0c";
print "[$a]\n";
if ( $a =~ /$ex/ ) {
print "found\n";
} else {
print "not found\n";
}