We don't bite newbies here... much | |
PerlMonks |
How to get a reference from an eval() string?by exilepanda (Friar) |
on Sep 06, 2016 at 09:26 UTC ( [id://1171237]=perlquestion: print w/replies, xml ) | Need Help?? |
exilepanda has asked for the wisdom of the Perl Monks concerning the following question:
Code comes first:
Above code demonstrated some sort what I want (but not entirely correct), however I have to make it one level up from the last "part". I know that I cannot directly get that reference via eval. like :
This just make $ref pointed to something else so this won't work. But I wonder is there any trick can do something like :
Provided that, I don't know what will be returned from the sub, and I don't know what's gonna be stored. both (return_from_sub and to write) can be array ref, hash ref, code ref, whatever ref or simple scalar.
Back to
Seekers of Perl Wisdom
|
|