in reply to Reading multiple values from a selection with CGI.pm
This took parameter GS1 from the form and put it into the first element of array @gene1.
@gene1 = split ('', $gene1);This takes scalar $gene1 and attempts to split it into the characters it contains. Since no assigment has been made to $gene1, you get an empty result back. This clears the array @gene1. Also, I doubt this code compiles since you never declared $gene1 and your code include use strict;. Are you getting http 500 errors?
print STDOUT $gene[0];This attempts to print an element from array @gene which has never been declared nor assigned to. Of course, nothing gets printed and this should also cause a compilation error due to not being declared.
Maybe what you wanted was this.
my $gene1 = $query->param('GS1'); my @gene1 = split('',$gene1); print STDOUT $gene1[0];
This is still somewhat broken since you output a header declaring your document to be text/html but you don't have any html tags in the output.
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Reading multiple values from a selection with CGI.pm
by roundboy (Sexton) on Jan 22, 2003 at 18:17 UTC |