Please take a look at the small sample code here.
I just don't understand why it actually finds a match!!
Sample run:
Thanks for your time and help!!
I just don't understand why it actually finds a match!!
Code:
#!/usr/bin/perl -w
my $str = "group=1,101,102";
my $ip = "1.1.1.1";
if($str =~ /$ip/) {
print "The string contains this IP!!\n"
}
else {
print "The string does not contain this IP!!\n"
}
print "String: #$str#\n";
print " IP: #$ip#\n";
exit;
Sample run:
Code:
./test.pl
The string contains this IP!!
String: #group=1,101,102#
IP: #1.1.1.1#
Thanks for your time and help!!