speedo has asked for the wisdom of the Perl Monks concerning the following question:
here's a piece of code that will print when run by my interpretter and on the web:
A slight alteration to this code prevents it from printing to the webpage:foreach $entry (@GILIST) { $seq1 = $gb->get_Seq_by_acc("$entry") || die "$entry is not a real + accession number.\n"; $speciesname = $seq1->species->common_name; $specieslist{$entry} = $speciesname; print p ("Gi# $entry is a $speciesname nucleotide sequence.\n"); }
And this version of the code does not print at all! :print p ("Gi# $entry is a $specieslist{$entry} nucleotide sequence +.\n");
And to add insult to injury the following version of my code prints when I run it with the interpretter but not on the web:foreach $entry (@GILIST) { $seq1 = $gb->get_Seq_by_acc("$entry") || die "$entry is not a real + accession number.\n"; $speciesname = $seq1->species->common_name; $specieslist{$entry} = $speciesname; } foreach my $entry (sort keys %specieslist) { print p ("GI# $entry is a $specieslist{$entry} nucleotide sequenc +e.\n"); }
In this case on the web it will print until the unless loops is "true". So does anyone have the SLIGHTEST INKLING what is happening?!? thanks in advance. . . . -speedoforeach $entry (@GILIST) { $seq1 = $gb->get_Seq_by_acc("$entry") || die "$entry is not a real + accession number.\n"; $speciesname = $seq1->species->common_name; unless ($speciesname eq $specieslist{$entry}) { $specieslist{$entry} = $speciesname; print p ("Gi# $entry is a $speciesname nucleotide sequence.\n" +); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: one of these codes is not like the other
by runrig (Abbot) on Jul 17, 2001 at 00:03 UTC | |
by speedo (Initiate) on Jul 17, 2001 at 01:07 UTC | |
by runrig (Abbot) on Jul 17, 2001 at 01:25 UTC | |
Re: one of these codes is not like the other
by nysus (Parson) on Jul 17, 2001 at 00:16 UTC | |
by damian1301 (Curate) on Jul 17, 2001 at 00:26 UTC | |
by runrig (Abbot) on Jul 17, 2001 at 01:58 UTC | |
by damian1301 (Curate) on Jul 17, 2001 at 02:06 UTC |
Back to
Seekers of Perl Wisdom