Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Perl script for running a CGI-BIN service over the web

by Anonymous Monk
on Oct 13, 2013 at 14:53 UTC ( #1058079=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi there Monks!
So, I am new to Perl and I need to create a script that can send data to a webpage (it's a tool that I need for my research) and then, when the service finishes running, get the results.
The web-tool is this:
http://www.csbio.sjtu.edu.cn/bioinf/Signal-3L/

and to see the results, you can use this example sequence:
MKMASSLAFLLLNFHVSLFLVQLLTPCSAQFSVLGPSGPILAMVGEDADLPCHLFPTM SAETMELRWVS +SSLRQVVNVYADGKEVEDRQSAPYRGRTSIL

So, I need first to select one of the radio-buttons, then paste the sequnce in the textarea, then press Submit and then, in the results page, either download it or "read" the result, which, in this example is:
According to Signal-3L engine for your selected species, the signal pe +ptide is:1-42

Can you give me hints/links on where to start? Because there are quite a few tools that I need to run through the web and it would be easier to know how to do it.
Thank you!

Comment on Perl script for running a CGI-BIN service over the web
Select or Download Code
Re: Perl script for running a CGI-BIN service over the web
by hippo (Curate) on Oct 13, 2013 at 15:44 UTC

    A good place to start would be LWP but only assuming that you know about HTTP. If that isn't the case, read up about HTTP first.

Re: Perl script for running a CGI-BIN service over the web
by NetWallah (Abbot) on Oct 13, 2013 at 17:24 UTC
    You need to send data to the web page using the POST method, as described in this stackoverflow article.

    THe equivalent GET is something like:

    http://www.csbio.sjtu.edu.cn/cgi-bin/Signal3L.cgi?R2=Plant&S1=MKMASSLA +FLLLNFHVSLFLVQLLTPCSAQFSVLGPSGPILAMVGEDADLPCHLFPTM SAETMELRWVSSSLRQVV +NVYADGKEVEDRQSAPYRGRTSIL&B1=Submit
    which did not work on your site because it requires POST.

    After the POST is sent, you need to write code to parse the response.

                 When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren

Re: Perl script for running a CGI-BIN service over the web
by CountZero (Bishop) on Oct 13, 2013 at 17:41 UTC
    Try WWW::Mechanize.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1058079]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-10-25 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (148 votes), past polls