0
votes

I am a newbie in Bioinformatics but I know perl scripting. I've written few scripts for parsing pdb files(protein crystal structure files). Now I want to run these in a web server. I have apache2 installed in my ubuntu. I have read something about the CGI and is in /usr/lib/cgi-bin/ in local web server. I need to have all my perl scripts in that directory. These scripts takes input from command line 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). At the end I should have a html page able to run my perl script (contacts.pl) upon user input.

If its not possible to run my perl script in html web page, what is the other alternative?

Any help will be greatly appreciated.

2
No PHP is required here and using PERL for web development has been covered in hundreds of online tutorials and dozens upon dozens of books.Jay Blanchard
Isn't it possible to run my perl code in a CGI perl script?Bionerd
Of course it is. You just need to do a little reading to see how all of the pieces fit together.Jay Blanchard
I have goggled for this..but I found many of those..Can you please provide me an address where I can easily understand, as I came from biology I am wondering which one to choose that best serves meBionerd
You have to read about HTML forms, Apache CGI configuration and generating HTML pages with perl (perhaps use CGI.pm). You need one HTML page that has a <form action="contacts.pl"> element, you collect user input here. When user clicks submit, the web browser sends input data to web server. A CGI enabled server, runs the script specified in form's action attribute and passes this data to it. The script does what you want with the inputs, and generates a HTTP response that is sent to the browser as response to form submission. These are steps involved in dynamic content generation using CGI.pii_ke

2 Answers

2
votes

I don't think I'd run everything through 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.

Some popular frameworks:

As for running the webserver, they should have deployment guides with instructions for apache. Or use another webserver like starman that can run perl webapps easily.