neemie has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to split a $string that is inputted into a webform made using CGI.pm
The split is on '>' and I have it working from the command line using shift to get the file into the script however using the webform doesn't work - i.e. I get no output. This works from the command line using shift to get the read in the file as follows:
my $inFile = shift; open (IN, "$inFile"); $/ = ">"; while ( my $record = <IN> ) { chomp $record; my ($defLine, @seqLines) = split /\n/, $record; my $sequence = join('',@seqLines);
however, using the code below in a cgi script does not work - I guess the cgi script is forcing a $string? but I'm not sure how to proceed
use CGI qw(:cgi-lib :standard); print "Content-type: text/html\n\n"; my $seq = param('sequence'); $/ = ">"; chomp $seq; my ($defLine, @seqLines) = split /\n/, $seq;
any advice, greatly appreciated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI perl reading input from webform in order to split
by GrandFather (Saint) on Dec 02, 2014 at 21:00 UTC | |
|
Re: CGI perl reading input from webform in order to split
by CountZero (Bishop) on Dec 02, 2014 at 21:04 UTC | |
|
Re: CGI perl reading input from webform in order to split
by Anonymous Monk on Dec 02, 2014 at 21:25 UTC | |
|
Re: CGI perl reading input from webform in order to split
by wazat (Monk) on Dec 02, 2014 at 21:04 UTC |