http://qs321.pair.com?node_id=1075167


in reply to Perl ignore arrow object operator in search/replace

But specially for your example, you can do it like
my $ip_wan = new NetAddr::IP("10.20.20.1/24"); my $ip_addr = $ip_wan->addr(); for (@line) { s/<IP_WAN>/$ip_addr/; }