Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: logic within interpolation

by karrakis (Novice)
on Mar 29, 2013 at 22:04 UTC ( #1026200=note: print w/ replies, xml ) Need Help??


in reply to Re: logic within interpolation
in thread logic within interpolation

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.


Comment on Re^2: logic within interpolation
Re^3: logic within interpolation
by kennethk (Monsignor) on Mar 29, 2013 at 22:18 UTC
Re^3: logic within interpolation
by hexcoder (Hermit) on Mar 30, 2013 at 18:57 UTC
    do you want to do this?

    eval "qq{$interpol}"

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (18)
As of 2014-12-18 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (48 votes), past polls