如何将Perl脚本的输出包含到PHP页面中?

编程入门 行业动态 更新时间:2024-10-10 08:19:21
本文介绍了如何将Perl脚本的输出包含到PHP页面中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们被要求在新网站上支持一些相当旧的Perl表单,因为我们正在使用基于PHP的CMS,我们需要将Perl脚本包含到我们的新CMS中。

We've been asked to support some rather old Perl forms on a new site, as we're using a PHP based CMS we need to include the Perl scripts into our new CMS.

我尝试过一些shell_exec但是已经禁用了。有没有人有任何想法?

I've tried a bit of shell_exec but that's disabled. Has anyone got any ideas?

推荐答案

Perl扩展

有一个可用于PHP的Perl扩展。

Perl extension

There is a Perl extension available for PHP.

Zend开发人员专区的一篇文章详细介绍了它这里。

An article from the Zend developer zone details it here.

该扩展程序允许您:

  • 加载并执行Perl文件
  • 评估Perl代码
  • 访问Perl变量
  • 调用Perl函数
  • 实例化Perl对象
  • 访问Perl对象的属性
  • 调用Perl对象的方法
  • load and execute Perl files
  • evaluate Perl code
  • access Perl variables
  • call Perl functions
  • instantiate Perl objects
  • access properties of Perl objects
  • call methods of Perl objects

您可以使用以下命令从CVS获取它:

You can obtain it from CVS using this command:

$ cvs -d :pserver:cvs.php:/repository co pecl/perl

此处列出了运行Perl脚本的示例:

An example of running a Perl script is listed here:

print "Hello from Perl! "

示例1(test1.php)

Example 1 (test1.php)

<?php print "Hello from PHP! "; $perl = new Perl(); $perl->require("test1.pl"); print "Bye! "; ?>

更多推荐

如何将Perl脚本的输出包含到PHP页面中?

本文发布于:2023-11-28 19:58:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643760.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   脚本   页面   Perl   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!