Dear Monks
I am trying to write a cgi perl cgi script that accepts a url like:
&xmin=100&xmax=200&other=parameters&
and return an image.
I am trying but new to cgi programming.
Here is my code. I know its a very very basic code that I have written but I guess its better to try then nothing ;)
#!/usr/bin/perl use CGI; my $query = new CGI; my $xmin = $query->param('xmin'); my $xmin = $query->param('xmax'); print "Content-type:text/html\n\n"; print "<html>"; if( $ENV{"REQUEST_METHOD" eq "GET"} ) { ($key, $value) = split(/=/,$ENV{"QUERY_STRING"}); } print "<li>Key is \" $key \" "; print "<li>Value is \" $value \" "; print "</html>";
I have to actually pass these values to a javascript like this in my html page:-
function query(x){ var url = '/MyScript.pl?chr=' + chr + '&version=5&layers=gene&organism=' + org + '&loc=' + x + '&' + 'ds=' + 588 jfetch(url,'query'); }
My input data can be like this
Chr1 100 200 cancer human Chr2 300 400 diabetes human Chr3 600 700 cough human
I know that I still have to work a lot on it but donno howto :(
I would really appreciate any help from dear Monks.
Thanks

In reply to Help in a cgi script by ashnator

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.