将文本从perl传递给PHP [英] Passing text from perl to PHP

查看:60
本文介绍了将文本从perl传递给PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




只是一个简单的问题


是否可以从Perl脚本中获取由此生成的一行文本Perl脚本并将其传递给PHP脚本,该脚本将处理Web方面的事情


我有Perl脚本提供输出测试,我有PHP文件只需要组合这两个文件都是在同一台PC上


谢谢Keith

解决方案

嗨Keith,


我敢肯定这是可能的。毫无疑问它很简单,但它确实是一个PHP问题,而不是Perl问题。由于它是一个Web应用程序,它将由处理Web请求的任何例程控制,并且您说您有一个PHP例程来处理Web端。任何Web请求的工作流程为:

展开 | 选择 | Wrap | 行号


感谢您的帮助Paul


我希望实现以下内容

展开 | 选择 | 换行 | 行号


啊!所以你根本不关心网络服务器上运行的是什么。您只是尝试将数据发送到收集您发送的数据的网络服务器?如果您与网络服务器的交互只是通过CGI界面,那么页面背后的脚本是PHP,Perl,C还是其他什么都没关系。


是否表格你发送要求POST?如果您需要使用POST方法,那么您使用的是错误的模块。 LWP :: Simple没有POST方法。请参阅 perlfaq9 关于该主题。有一个模块 LWP ::简单::发布您可以使用。


或者,您可以查看从LWP中获得更多信息::简单,这确实有一些建议,包括网页脚本通常并不在乎如果您使用GET而不是POST提交。在任何情况下都可能值得阅读。


HTH,

Paul


Hi

Just a quick question

Is it possible from a Perl script to take a line of text which is generated by this Perl script and pass it to a PHP script which will deal with the web side of things

I have the Perl script that gives the output test and I have the PHP file just need to combine the two

Both files are all on the same PC

Thanks Keith

解决方案

Hi Keith,

I''m sure it is possible. It''s undoubtedly even easy, but it''s really a PHP question, not a Perl question. Since it''s a web application, it will be controlled by whatever routine handles the web request and you said that you have a PHP routine that handles the web end of it. The workflow of any web request is:

Expand|Select|Wrap|Line Numbers


Thanks for the help Paul

What i want to achieve to something like below

Expand|Select|Wrap|Line Numbers


Ah! So you don''t really care at all what is running on the webserver. You are just trying to send data to a webserver that collects the data you send it? If your interaction with a webserver is just through the CGI interface, it really doesn''t matter whether the script behind the page is PHP, Perl, C or whatever.

Does the form you are sending to require POST? If you need to use a POST method, then you are using the wrong module. LWP::Simple does not have a POST method. See perlfaq9 on that topic. There is a module LWP::Simple::Post that you might be able to use.

Alternatively, you might check out Getting more out of LWP::Simple, which does have some suggestions including the fact that web scripts often don''t really care if you submit using GET instead of POST. It''s probably worthwhile reading in any case.

HTH,
Paul


这篇关于将文本从perl传递给PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆