in reply to RE (tilly) 4: Perlmonks Code Proxy
in thread Perlmonks Code Proxy

yeah - I was saying that if you matched code on the right side, and then used that code in the eval expression with $1, it wouldnot get executed.

AKA, saying s/(stuff)/$1/eg would not do anything even if the stuff captured in $1 was perl code.

$string = "print 'got an o\n'"; $string =~ s/(.*)/$1/eg;
Doesn't print anything.

Replies are listed 'Best First'.
RE (tilly) 6: Perlmonks Code Proxy
by tilly (Archbishop) on Aug 19, 2000 at 02:42 UTC
    OK, I misunderstood what you were trying to figure out.

    Even so ehis should not be a surprise. Execute the statement $var and nothing happens except that the contents of $var are returned. Same thing with $1. Execute it and it returns the contents of $1 as a string, presumably to be placed back in the original string.

    But try using the modifier /eeg and see what that does. :-)