Does anyone know if it is possible to store Perl statements in a data field in a mysql table such that they will be executed when the field is read and displayed in a pl/cgi script file?
If so, could you please share that methodology with me?
I don't know of any way to make them automatically execute, but you can execute them yourself using the eval("perl commands" function. Tracy Dryden
tracy@bydisn.com
You're welcome! That's what we'e here for! Glad I was able to help. BTW, now that I have time, here's a little more info on eval:
The string being eval'ed is run just as if it were a little perl program. It is executed in the context of the current program, so any variable settings or subroutine definitions remain afterwards. The value returned by eval is the value of the last expression evaluated, or a return may be used just like in a subroutine. You don't have to have a semicolon at the end of the last statement.
If there is a syntax error, a runtime error, or a die statement is executed, the undefined value is returned, and $@ is set to the error message (this can be useful for debugging). Otherwise $@ will be null.
Tracy Dryden
tracy@bydisn.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.