I have a task to parse some PHP codes and mine some system-wide constants out and apply it in my Perl code as own constants.
I think it is possible by parsing out the constant name, and value from the PHP file, and then eval a constant declaration.
But the Perl interpreter thinks otherwise:
So what's wrong?eval "use constant CONST1=>5" or warn $@; # when I run this I get: +Warning: something's wrong at ./consteval.pl line 3.
--
tune
In reply to constant and eval (are they enemies?) by tune
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |