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