We don't bite newbies here... much | |
PerlMonks |
Filter::Util::Call does not work in eval?by withering (Monk) |
on Sep 25, 2014 at 07:33 UTC ( [id://1101913]=perlquestion: print w/replies, xml ) | Need Help?? |
withering has asked for the wisdom of the Perl Monks concerning the following question: Hello fellow monks. The code below uses a source code filter, which replaces all "word"s with "worlds". However, it only prints "Hello word" instead of "Hello world".
The problem is that I use eval to evaluate the code string. Actually, perl -e 'use filtertest; print "Hello word\n"' gives the same, i.e. wrong, result. But
works properly. It seems the BEGIN magic of the filter is not executed when being 'eval'ed. Does this mean that Filter::Util::Call confilcts with the builtin eval function? Thanks in advance. Feel free to correct my mistakes.
Back to
Seekers of Perl Wisdom
|
|