in reply to Evaluating a regex replacement value

If i understood your question correctly, add e option modifier, to eavluate

$line = '<:KEYWORD:4:>'; $value = 5; $line =~ s/<:KEYWORD:([^:>]*):?>/($1 != 0)? ($value * $1) : $value/e; print "$line";

updated:

Prasad

Replies are listed 'Best First'.
Re^2: Evaluating a regex replacement value
by McDarren (Abbot) on Oct 05, 2005 at 12:51 UTC
    duh!!
    *slaps forehead*
    I forgot all about the 'e' modifier... I really should pay closer attention to the doco.

    Thanks,
    --Darren