tune has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks!
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
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: constant and eval (are they enemies?)
by merlyn (Sage) on May 22, 2002 at 20:52 UTC | |
Re: constant and eval (are they enemies?)
by Juerd (Abbot) on May 22, 2002 at 19:53 UTC | |
Re: constant and eval (are they enemies?)
by Anonymous Monk on May 22, 2002 at 19:52 UTC | |
by tune (Curate) on May 22, 2002 at 19:59 UTC | |
by Anonymous Monk on May 24, 2002 at 00:20 UTC | |
by merlyn (Sage) on May 24, 2002 at 00:28 UTC |
Back to
Seekers of Perl Wisdom