|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: |
Here is the html code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Form Example</title>
</head>
<body>
<!-- Insert your content here -->
<form action="/gagejd_assign3.pl" method="POST">
Please enter your sequence: <input type="text" name="userseq" /><br />
<input type="submit" name="submit" value="Submit" />
<BR>
<BR>
<a href=/gagejd_assign3.html>Click Assignment 2 to try another sequence analysis.</a>
</form>
</body>
</html>
And here is the CGI perl file:
#!/usr/bin/perl -w
use strict;
use CGI;
my $cgi=new CGI;
print $cgi->header();
print $cgi->start_html(-title=>'Form Results',
-author=>'Julian Gage');
my $seq=$cgi->param("userseq");
$seq=uc($seq);
my $len=length($seq);
my $count_a=0;
my $count_t=0;
my $count_g=0;
my $count_c=0;
my $count_n=0;
$count_a=($seq=~tr/A/a/);
$count_t=($seq=~tr/T/t/);
$count_g=($seq=~tr/G/g/);
$count_c=($seq=~tr/C/c/);
$count_n=($seq=~tr/N/n/);
print ("[Sequence that you entered is:]=($seq)<br>");
print ("[The sequence length:]=($len)<br>");
print ("[A count]=($count_a)<br>");
print ("[T count]=($count_t)<br>");
print ("[G count]=($count_g)<br>");
print ("[C count]=($count_c)<br>");
print ("[N count]=($count_n)<br>");
print (<a href=\. ./formEasy0.html \''> click here to continue</a>'');
print $cgi->end_html."\n";
|
Advertisement
| Hall of Fame |