求助:在线提交任务的程序

求助:在线提交任务的程序

求助:在线提交任务的程序
#/usr/bin/perl -w
use IO::Socket;
$name=">first";
$seq="gcactccagcctggcctatggtaggagactttctcaaaaaaaaaaaaaaaaaaaaaaaaTTACTTATTGAggccgggcgcagtggctcacgcctgtaatcccagcactttgggaggccgaggcgggcggatcacaaggtcaggagatcgagaccatcctggctaatacggtgaaaccccgtctctactaaaaatacaaaaaaattagccgggcatggtcctgggtgcctgtagtcccagctactcgggaaggcgtgaacctgggaggcagagcttacagtgagccgagattgtgccactgcactccagcccgggtgacagagcgagactccatttcaaaaaaaaaaaTtacttattgagcatctacttgccaggcattgtctgggtaatgaggacacagcagaaaagaaaatgtgcaagattcttgtgccccaggcgcttacataggggtggggagagatgaataaacaagaaaaaaacaccaaatccacacagcactga";
genemark($name,$seq);
sub genemark {
my ($name, $seq) = @_;
my $socket = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr =>"http://opal.biology.gatech.edu",
PeerPort => 80,
);
# $socket->autoflush(1);
$str='?'."title=".$name."&"."sequence=".$seq;
print $str,"\n";
print $socket "GET /GeneMark/eukhmm.cgi$str',
'HTTP/1.0\015\012\015\012";
while($line = <$socket>){
$html.=$line;
}
close $socket;
print $html;
}
我照着书上找了一个网址写的程序,结果总是说Can't use an undefined value as a symbol reference at connect.pl line 17.
但是试了好多方式,还是一直是这个问题.不知道在这样的程序里面,第17行该怎么写?
[quote]--#/usr/bin/per.
改一下代码:
[quote]
#/usr/bin/perl
use IO::Socket;
$name=">first";
$seq="gcactccagcctggcctatggtaggagactttctcaaaaaaaaaaaaaaaaaaaaaaaaTTACTTATTGAggccgggcgcagtggctcacgcctgtaatcccagcactttgggaggccgaggcgggcggatcacaaggtcaggagatcgagaccatcctggctaatacggtgaaaccccgtctctactaaaaatacaaaaaaattagccgggcatggtcctgggtgcctgtagtcccagctactcgggaaggcgtgaacctgggaggcagagcttacagtgagccgagattgtgccactgcactccagcccgggtgacagagcgagactccatttcaaaaaaaaaaaTtacttattgagcatctacttgccaggcattgtctgggtaatgaggacacagcagaaaagaaaatgtgcaagattcttgtgccccaggcgcttacataggggtggggagagatgaataaacaagaaaaaaacaccaaatccacacagcactga";
genemark($name,$seq);
sub genemark {
my ($name, $seq) = @_;
my $socket = IO::Socket::INET->new(
Proto => "tcp",
PeerAddr =>"opal.biology.gatech.edu",
PeerPort => 80,
);
# $socket->autoflush(1);
$str='?'."title=".$name."&"."sequence=".$seq;
print $str,"\n";
print $socket "GET /GeneMark/eukhmm.cgi$str',
'HTTP/1.0\015\012\015\012";
while($line = <$socket>){
$html.=$line;
}
close $socket;
print $html;
}
[/quote]

最好还是先看看 perl 语法书籍,这样写程序的时候语法的问题就不成问题了. :-P




   

我是照着书上写的,只不过其没有给出具体的例子,结果我就写不对了:(
不知道你见过这种写法没?我查了好久都没有找到这种写法,是不是现在没有了?
这个程序一直都有问题
#/usr/bin/perl -w
use IO::Socket;
$nm=">first";
$s="gcactccagcctggcctatggtaggagactttctcaaaaaaaaaaaaaaaaaaaaaaaaTTACTTATTGAggccgggcgcagtggctcacgcctgtaatcccagcactttgggaggccgaggcgggcggatcacaaggtcaggagatcgagaccatcctggctaatacggtgaaaccccgtctctactaaaaatacaaaaaaattagccgggcatggtcctgggtgcctgtagtcccagctactcgggaaggcgtgaacctgggaggcagagcttacagtgagccgagattgtgccactgcactccagcccgggtgacagagcgagactccatttcaaaaaaaaaaaTtacttattgagcatctacttgccaggcattgtctgggtaatgaggacacagcagaaaagaaaatgtgcaagattcttgtgccccaggcgcttacataggggtggggagagatgaataaacaagaaaaaaacaccaaatccacacagcactga";

my $proxy = "192.168.1.1:80";
my $CRLF = "\015\012";
genemark($nm,$s);
sub genemark {
my ($name, $seq) = @_;
my $S = IO::Socket::INET->new($proxy) || die("Cannot open the socket\n");
my $URL = "http://opal.biology.gatech.edu/GeneMark/eukhmm.cgi";

$content = "&title=$name&sequence=$seq&org=O%2esativa&Action=Start%20GeneMark%2ehmm";
$content_len = length($content);
$request = join($CRLF =>
"POST $URL HTTP/1.0",
"Content-Type: application/x-www-form-urlencoded",
"Content-Length: $content_len",
"",
"");
print $S "$request$content";
while (<$S>){ print; }
print "\n";
close($S);
}
我回复给你的代码是OK的.
嗯.第二次说得代码是另一个网友说得,但是在我这里实现不了.所以想让你再帮忙看看,呵呵
第二个程序也没有问题,不过要确保你的 web 代理 192.168.1.1:80 能正常访问,而且该代理拥有访问 opal.biology.gatech.edu 的能力
如果我不用代理呢?那该怎么写?写服务器的IP?但是登陆服务器是需要密码的,该怎么写?