http://www.perlmonks.org?node_id=1028582


in reply to interpolating operators within strings

Try using "eval" : see "perldoc -f eval".

my $a = eval "2 $_ 2";
This is not considered "safe" because it is possible to inject unwanted code into the eval string.
It is fine for testing purposes.

             "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
        -- Dr. Cox, Scrubs