Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl statments stored in data field of mysql table?

Status
Not open for further replies.

dajo

IS-IT--Management
Jan 13, 2001
27
US
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?

Thanks!
 
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

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Hey, thanks for answering! That's exactly what I meant!

I want a way to embed decision logic within the text entry and this does it.

Thanks again!
 
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

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top