Hi, I'm not sure how to approach this problem. I would like to present some information on a web page using perl cgi. Essentially, the following code works. It searches several files (initiated by the contents of N_structures.txt) for relevant information, i then want to present this information on a web site, perhaps in the form of a table. So that $GU_web (column1), $image (column2) and $structure_name (column 3). Is this possible? I know how to present the information for a single file but how to extent this?
open (Struct, "N_structures.txt"); while (<Struct>) { /(\d+).*/; $number = $1; open (info_web, "<" . "$number" ."_info.txt"); $i=1; while (<info_web>) { if (/^(\d+\.\d+)\D/) {$GU_web = $1;} if ($i >1) { last;} print "$GU_web\n"; $i++; } close (info_web); #open (image, "<" . "images/" . "$number" . "gif"); $image = <IMG SRC="images/$number.gif">; open (name, "<" . "gly_structures.txt"); while (<name>) { ($ref_num, $glycan_name) = (split /| +/, $_); if ($ref_num == $number) {$structure +_name = $glycan_name;} } $insert_html = <td>$GU</td> <td>$image</td> <td>structure_name></td> }
Thanks

In reply to cgi question by Anonymous Monk

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.