简体   繁体   English

在CGI脚本中运行perl脚本

[英]Run perl script inside CGI script

I am a newbie in Bioinformatics but I know perl scripting. 我是生物信息学的新手,但我知道perl脚本。 I've written few scripts for parsing pdb files(protein crystal structure files). 我写了一些脚本来解析pdb文件(蛋白质晶体结构文件)。 Now I want to run these in a web server. 现在,我想在Web服务器中运行它们。 I have apache2 installed in my ubuntu. 我在ubuntu中安装了apache2。 I have read something about the CGI and is in /usr/lib/cgi-bin/ in local web server. 我已经阅读了有关CGI的内容,并且位于本地Web服务器的/usr/lib/cgi-bin/中。 I need to have all my perl scripts in that directory. 我需要将所有perl脚本都放在该目录中。 These scripts takes input from command line ex: perl contacts.pl pdbFile.pdb . 这些脚本从命令行ex: perl contacts.pl pdbFile.pdb接受输入ex: perl contacts.pl pdbFile.pdb

Now how can I run these scripts inside a perl CGI script so that the CGI script throws html page on the fly and asks for user input (this includes PHP I guess). 现在,我如何在perl CGI脚本中运行这些脚本,以便CGI脚本即时抛出html页面并要求用户输入(我猜这包括PHP)。 At the end I should have a html page able to run my perl script ( contacts.pl ) upon user input. 最后,我应该有一个HTML页面,该页面能够在用户输入时运行我的perl脚本( contacts.pl )。

If its not possible to run my perl script in html web page, what is the other alternative? 如果无法在html网页中运行我的perl脚本,另一种选择是什么?

Any help will be greatly appreciated. 任何帮助将不胜感激。

I don't think I'd run everything through CGI. 我认为我不会通过CGI运行所有内容。 If I were you, I'd look at using a perl web framework to handle generating the webpages and (presumably) uploading files, and then call your existing code to parse the pdb files and get whatever you're interested in. 如果您是我,我将考虑使用perl Web框架来处理生成网页和(大概)上载文件,然后调用您现有的代码来解析pdb文件并获得您感兴趣的任何内容。

Some popular frameworks: 一些流行的框架:

As for running the webserver, they should have deployment guides with instructions for apache. 至于运行Web服务器,他们应该具有有关Apache的部署指南。 Or use another webserver like starman that can run perl webapps easily. 或使用像starman这样的其他网络服务器来轻松运行perl webapps。

For a start you can get basic ideas from below links : 首先,您可以从以下链接中获得基本思想:

Perl/CGI script with Apache2 Apache2的Perl / CGI脚本

CGI script calling a perl script 调用perl脚本的CGI脚本

First Perl CGI script 第一个Perl CGI脚本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM