Hello Monks, I am a newbie to the programming world and recently started a master in bioinformatics (must admit i am enjoying it alot but my background is in pharmaceutics so I know nothing of perl html etc)

I have only had a week of lessons so my knowledge is very, very limited and please take this into account when your laughing at my post/coding comments lol

I have produced a very basic program in perl which allows a user to enter a file, it extracts the DNA data, I format the data and then allow the user to input another file to format the data further before printing it out.

The last part of the assignment requires me to display this in a HTML format and allow the bases to be colour coordinated etc so here is my code:
#writing the results into an output HTML file. $outputfile = 'html_assignment.html'; open (OUTFILE, ">$outputfile"); print OUTFILE "<html> <head> <title> Applied Bioinformatics Assignment 1 </title> </body> </html>"; # user entry of DNA sequence prompt asking if DNA will be manually ent +ered or a file uploaded #manual input will allow a check to occur to ensure correct entry. print "To upload a file containing your DNA sequence press 1, or alter +nativly press 2 to manually enter your DNA sequence \n\n"; $usrinput = <STDIN>; chomp $usrinput;
Then the second part of my code to display my results is this:
#start the string from position 0 $revprotein3 = substr($dna,3); #Translate the DNA to protein $revprotein3 = dna2peptide($revprotein3); #Print the sequence in lines of 50 characters long print "\n\n<----------------Reverse compliment peptide frame 3-------- +--------> \n\n"; print_sequence ($revprotein3,50); # printing data sequences to HTML print OUTFILE "<table boarder = 0 width = 25> <tr><td> Peptide sequence frame 1</td></tr> <tr></tr> <tr><td> $protein </td></tr> <tr></tr> <tr><td> Peptide sequence frame 2 </td></tr> <tr></tr> <tr><td> $protein2 </td></tr> <tr></tr> <tr><td> Peptide sequence frame 3 </td></tr> <tr></tr> <tr><td> $protein3 </td></tr> <tr></tr> <tr><td> Peptide reverse compliment sequence Frame 1 </tr></td> <tr></tr> <tr><td> $revprotein </td></tr> <tr></tr> <tr><td> Peptide reverse compliment sequence Frame 2 </tr></td> <tr></tr> <tr><td> $revprotein2 </td></tr> <tr></tr> <tr><td> Peptide reverse compliment sequence Frame 2 </tr></td> <tr></tr> <tr><td> $revprotein3 </td></tr>";
The question's I have are:

As you will have noticed I have tried to limit the column table length hoping it will displayed onto another line (like you get in word) but it does not seem to be working can anyone help?

Second part I want each character to be displayed in a different colour can anyone provide some pointers?

Last question, is there a more efficient way to import stuff outinto HTML format, taking into consideration I am a newbie I need something that is easy to follow please

I dont want to be spoon fed but obviously alot of people reply back with their own interpution of code as an answer, if possible could you explain what is going on as its more important to me to learn then to copy and paste someone's answer or any links to tutorials or guides for beginners would be nice

thanks in advance :)

In reply to PERL HTML HELP by Singh121

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.