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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you call php from within perl?

Status
Not open for further replies.

cleansedbb

Technical User
Feb 11, 2002
95
US
I have a perl script which does mysql calls. it's easier to do more complex calls in php so I want to call my script and just pass the $result field to be printed.

my question is how to I call php? just add <?php ?> in the perl script?

thanks for your input

CBB
 
It would probably be much slower to use the method you are using. The way I do MySQL calls in Perl is to make subroutines to make the process easier. One called db_connect (to connect to the DB), one called db_query (to query the database) and then db_disconnect.

If you design these right, it makes it much easier to interface with MySQL. - Ben
 
PHP only runs in a web server context. PHP output is generally something that looks like a web page coming from a web server. You can make an http request for a web page with perl using the LWP module.

However, I agree with Ben, that you'd be over-complicating the situation. The Perl DBI/DBD architecture works very well with MySQL. If you are having problems with it, I'd post specific questions here and/or get a copy of &quot;Programming the Perl DBI&quot; by Descarte and Bunce, published by O'Reilly. 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
thanks for the input I'll be looking for the book and may be posting other ?'s

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top