in reply to Re: Evaluating a regex replacement value
in thread Evaluating a regex replacement value

heh... "substituting certain keywords with variables"... was badly worded - what I should have said was: "substituting certain keywords with the values of associated variables"

For example, I have stuff like:
$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; } }
(I'm in the process of abstracting the keyword/value pairs into a lookup hash, as per my previous post)