Hello all.
The code below issues an error. How can I get it to work (check if variable $str has the chrachter value)?
code is:
#!/usr/bin/perl -w
#1 line checker
#use strict;
$m='(';
print $m,"\n";
$str="Hello\(\n";
$true=($str=~m/$m/);
print $true , "\n";
And the PERL engine error is:
liord@analog4 188 > ~/linecheck.pl
(
Unmatched ( in regex; marked by <-- HERE in m/( <-- HERE / at /users/l
+iord/linecheck.pl line 7.
Exit 9
The following code works, but it is not parametric, and of no added value:
#!/usr/bin/perl -w
#1 line checker
#use strict;
$m='(';
print $m,"\n";
$str="Hello\(\n";
$true=($str=~m/\(/);
print $true , "\n";