No, i don't think there is. Php is dependent on its file extension. You can only execute php script code within a valid php script.. it's different to perl as everything in a perl script is perl, but a php script is really an html doc but with embedded tags representing the php code. e.g

PHP was made especially for web server-side scripting. Perl was adapted to function as a CGI method of parsing requests. Why make it harder on yourself by using such an advanced language as perl when you can have an easier and more successful time with php.

Because with a more advanced language you get the benefits of more advanced features. Plus i only know Perl so thats my only option. I have looked a little at Php code and so forth but it looked a lot longer to do nearly the same tasks perl does. Maybe i misinterpretted it but i like it when i can write shorter code so it doesnt take as long to pump out scripts.

Both PHP and Perl are well-suited for CGI. Preference usually lies against the unknown. I prefer Perl because I can't program as fluently in PHP as I do Perl. People who know PHP can say the same about PHP.

PHP is a cgi-only language, and if cgi is the reason anyone needs to program at all, then it may be a perfect choice. Perl is a complete programming language that can be programmed for cgi scripts in addition to the development of complete standalone programs (not web-based).

For those who need only cgi programs, then PHP may be their best choice. For those who need to program outside of a cgi-only environment, Perl, C, VB, etc. are more suitable solutions.

The important thing to understand is that saying "x is better than y" merely demonstrates ignorance of the other language and is not factual, regargless of the language discussed. Each language has its strengths and weaknesses. Adcovacy can be a Very Bad Thing when implemented improperly. Check out Mark-Jason Dominus' "Why I Hate Advocacy" article.

The one thing I would ask of Kagey is if "PHP is much better", why do you need to run a Perl script inside your PHP program? That's not a rhetorical question.

Oh, i'm not saying PHP is a better language than Perl. I'm just saying it's more suited to web development.. and easier for beginners. Referring to a previous post stating php code takes a lot longer to do the same tasks perl does - That is completely the opposite. When gathering the information from a form all you need to do is access the input names, they're automatically made available to you unlike perl where you have to parse the STDIN.

I'm not knocking perl.. I love it (why else would I be on this forum?) And, technically speaking.. PHP isn't CGI. You can compile it on your server as a CGI but it's actually a module.

And..I found out the function to call an external script. Use Virtual()

Actually, if you are running a small site that will probably not grow too much, PHP will fit the bill, as will Cold Fusion.... BUT... IF you may want to eventually run big iron hi-vol, you will probably have to re-write into modperl or something like it...that is, if you are not into huge server farms in order to handle the load. Bottom line: Its easier to re-write Perl into modPerl, than it is to rewrite from PHP, or install a dozen extra servers. I prefer Perl, even for small sites. It don't crash for no reason as often .

Just my experiance... your mileage may differ. I am doing some sites in PHP also, by the way.. easy to learn.

Thank goodness someone actually addressed the first question! Yes, you can execute a PHP script from a perl script. You call the php interpreter as an external program and tell it which file to parse. Using the backticks you will capture the output from the php interpreter. You can then simply print that out, or do something to it first.