$line =~ s/<:INCOMING:([^:>]*):?>/int($incoming * ($1 || 1))/e; $line =~ s/<:OUTGOING:([^:>]*):?>/int($outgoing * ($1 || 1))/e; $line =~ s/<:INGRESS:>/$eth1/; $line =~ s/<:EGRESS:>/$eth0/; if ($line =~ /<:RADIUS:>/) { foreach my $ip (@radius_ips) { $thisline = $line; $thisline =~ s/<:RADIUS:>/$ip/; print OUT $thisline; } }