in reply to HTML coded for in PERL

This line has the </TR> and </TD> flipped, which could be making your browser unhappy:
print("<TR><TD WIDTH=100%><B>Enzyme number $counter</B></TR></TD>");
Besides that, what are sample values for the variables ($counter, $recSite, $anotate, @cut)?

Replies are listed 'Best First'.
Re^2: HTML coded for in PERL
by Fletch (Bishop) on May 18, 2005 at 17:06 UTC

    Good catch. Using a here doc (<<EOT) rather than multiple print statements can make it easer to see what you're actually going to output rather than adding extra visual noise. Also consider using a templating module (Template or the like) and separate the presentation and markup from the code.

    Update: Or qq{} as jeffa mentions below is also a good way to do it. And also not a Perl problem, but you really should have quotes around the attribute values (width="100%")</XHTML-Pedant>

    Update Update: And to be a real stickler you should be using CSS rather than width attributes and tables . . .

Re: HTML coded for in PERL
by MonkPaul (Friar) on May 18, 2005 at 17:06 UTC
    Yes Sorry.

    The $counter is as it sounds a counter, whcih is taken from an external sub foreach loop.
    The $recSite is a string variable showing the recognition site for an enzyme cleavage location i.e G^ATATGAG.
    The $anotate is another string that shows the binding site of an enzyme in a DNA sequence i.e AGTATACGTTCAACGCA
    The @cut is an array of fragments cut by the enzyme at the $recSite position, highlighted by the $anotate sequence.

      Right, but what are the exact values (especially for @cut)? Can you provide the actual generated HTML that's too wide? I suspect (as some of the other responders have, too) that @cut has some big long chunk of whitespace-less text in it.
        The output for @ cut would be something like
        Digested:AGCTGACGTCG AATTCGCAGGTCAGTACTACGTCGAGTACGGTACTGGACGTACGTGCAT +GTGTGTACGTGACTTACGTGACTGATCGATCGACGTAGCTGTTGTGTACTACTATCGATCGTACTTACT +GATGCTATATATTAGCGCGCTGCGTAGCTAGTCGCTATCGTGA