Perhaps you haven't replaced it correctly?
use 5.010;
my @lines = ("ip:192.168.243.1", "ip:192.168.243.2" =~
/(ip:[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/);
say for @lines;
__END__
ip:192.168.243.1
ip:192.168.243.2
Do note that
ip:192.168.243.2 is in @lines only because the pattern matches the entire string. And do note that
"ip:192.168.243.1" is
not subject to any matching. In fact, the assignment to @lines is equivalent with:
my @lines;
$lines[0] = "ip:192.168.243.1";
push @lines, $1 if "ip:192.168.243.2" =~ /(ip:[0-9]{1,3}\.[0-9]{1,3}\.
+[0-9]{1,3}\.[0-9]{1,3})/;