P
Peter Scott
c> @{[mysub(1,2,3)]}
c> good grief. Thanks
and that is considered a poor construct. i never use it (or its scalar
cousin) nor do i recommend it. when i review code, i downgrade when i
see that used. it is simpler and better to just assign to a variable
before the string and then interpolate it. also it will likely be faster
as you don't need the reference/dereference. also it will only call your
code in a list context (even the scalar form!) which may be a problem.
assigning to your own variable allows you to control the context as
well.
There is always MJD's Evaluation module (looks like Jenda's expanded on
it some); elegant in execution, a bit heavyweight in the setup, but worth
knowing:
use Evaluation E => 'eval';
qq[The common term for H2O is $E{ chem("H2O") }.]