G
grocery_stocker
I can't seem to get perl to match both the words 'chad' AND 'party'
in the string "chad ttyp0 party". Below is what I attempted.
[cdalten@localhost oakland]$ more match.pl
#!/usr/bin/perl
use warnings;
#$string = `w | grep cdalten | grep telnet`;
$test = "chad ttyp0 party";
if ("$test" =~/(\bchad\b)(\bparty\b)/) {
print "true \n";
}
[cdalten@localhost oakland]$ ./match.pl
[cdalten@localhost oakland]$
What am I doing wrong>
in the string "chad ttyp0 party". Below is what I attempted.
[cdalten@localhost oakland]$ more match.pl
#!/usr/bin/perl
use warnings;
#$string = `w | grep cdalten | grep telnet`;
$test = "chad ttyp0 party";
if ("$test" =~/(\bchad\b)(\bparty\b)/) {
print "true \n";
}
[cdalten@localhost oakland]$ ./match.pl
[cdalten@localhost oakland]$
What am I doing wrong>