Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: logic within interpolation

by Anonymous Monk
on Mar 29, 2013 at 21:35 UTC ( #1026195=note: print w/ replies, xml ) Need Help??

Comment on Re: logic within interpolation
Re^2: logic within interpolation
by McA (Priest) on Mar 29, 2013 at 21:40 UTC

    You must have a copy & paste buffer dedicated to this answer... ;-)

Re^2: logic within interpolation
by karrakis (Novice) on Mar 29, 2013 at 22:04 UTC
    the problem actually lies in the 'nesting' of the interpolations being done.

    ${if(this){return 'this';}} is fine, because the single quotes do not result in this during eval:

    eval ""this""; <- problem.

    eval "'this'"; <- evaluated properly.

    So the problem is I need to find a way to interpolate the contents of $1 and *then* have those contents interpolated again. I think I'm on the right track now, but thanks for the boilerplate, some of that looks to be useful reading.

      do you want to do this?

      eval "qq{$interpol}"

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026195]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2015-07-07 13:03 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (88 votes), past polls