I have written this code, but it does not work. Can someone point out the issue?
sub match_ip()
{
my $ip = \"The IP address is 216.108.225.236:60099\";
i
This might help:
my $ip = "195.249.61.14";
my @ips = (
"set protocols bgp group IBGP-RRCL-CUSTOMER neighbor 195.249.61.142",
"set protocols bgp group IBGP-RRCL-CUSTOMER neighbor 195.249.61.14",
"set protocols bgp group IBGP-RRCL-CUSTOMER neighbor 195.249.61.141"
);
foreach (@ips) {
print "$_\n" if ( /\b$ip\b/ );
}
Output:
set protocols bgp group IBGP-RRCL-CUSTOMER neighbor 195.249.61.14