Home > Archive > PERL CGI Beginners > September 2004 > undefined value error
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
undefined value error
|
|
| Xiangli Zhang 2004-09-24, 3:55 am |
| Hi, Gunnar:
The error happened on lines with "***"
Error happened when the method "sequence" was called. It said "$sa, $sb" are undefined value. But when i run the called cgi from command line (linux terminal), the output is correct as expected.
Which means in the browser running of this cgi, $sa, $sb did not get value?
The modules I am using are self-programmed module for DNA sequencing.
thanks,
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use warnings;
use diagnostics;
use DNAalign;
use fastream;
use DNAseq;
print "Content-type: text/html\n\n";
print "<html><head><title>Perl CGI Example # 2";
print "</title></head><body><h1>";
print "Alignment Result </h1><p>";
print "<pre>";
chdir("/srv/www/httmp/default/chromat_dir");
my $seq1=fastream->new("default.fasta.screen.contigs");
my $seq2=fastream->new("secondFile");
my $test1=$seq1->next_seq();
my $test2=$seq2->next_seq();
my $s1=$test1->sequence();
my $s2=$test2->sequence();
print "input1===$s1\n";
print "input2===$s2\n";
($sa,$sb)=DNAalign::align($test1,$test1)
;
***$result1=$sa->sequence();
***$result2=$sb->sequence();
print "\n";
print "result1=== $result1\n";
print "result2=== $result2\n";
print "</pre>";
print "</p>";
print "</body></html>";
Xiangli Zhang (Justin)
306-310 Decaire Street, Coquitlam
BC, Canada, V3K 6X1
phone: 604-9399181
---------------------------------
Post your free ad now! Yahoo! Canada Personals
| |
| Gunnar Hjalmarsson 2004-09-24, 3:55 am |
| Xiangli Zhang wrote:
> The error happened on lines with "***"
>
> Error happened when the method "sequence" was called. It said "$sa,
> $sb" are undefined value. But when i run the called cgi from
> command line (linux terminal), the output is correct as expected.
>
> Which means in the browser running of this cgi, $sa, $sb did not
> get value? The modules I am using are self-programmed module for
> DNA sequencing.
Then you'd better look for the problem in those modules, right?
Even if I haven't seen them, I suspect that you have not properly
checked for success when for instance opening files. So that's what I
recommend you to do: Revise the code in the modules, and make sure you
capture possible failures when they occur.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
|
|
|
|
|