what is wrong with my script
- From: chen_li3@xxxxxxxxx (Chen Li)
- Date: Thu, 31 Aug 2006 11:09:03 -0700 (PDT)
Hi guys,
I have a CGI script to process some data from the
visitors. The input data takes this format(row x
column):
1 2 4 5 6 7
100 90 50 30 20 0
After processing I want to print out the result in the
same format(row x column). But when I ran my script I
only get a row only:
1 2 4 5 6 7 100 90 50 30 20 0
It looks like all lines are changed into a string
only. Can anyone there give me a hand?
Thanks,
Li
here is the code:
#!c:/Perl/bin/perl.exe
use warnings;
use strict;
use CGI qw/:standard/;
###################create forms
my $q=CGI->new();
$q->header,
$q->start_html('Survival Curve'),
$q->h1('Survival Curve'),
$q->start_form(),
$q->textarea( -name=>'data',
-default=>'',
-rows=>10,
-columns=>50),
$q->p,
$q->submit('Submit'),
$q->end_form();
######################process the data
my @data=();
my $cgi=CGI->new();
my $line=$cgi->param('data');
if ($line ne '' ){
my @temp=split/\t+/,$line;
push @data,[@temp];
}
for my $ref(@data){
print "\t@$ref","\n";
print $cgi->p;
}
print $q->end_html();
exit;
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
.
- Follow-Ups:
- Re: what is wrong with my script
- From: Paul Lalli
- Re: what is wrong with my script
- From: Joshua Colson
- Re: what is wrong with my script
- Prev by Date: RE: Totally lost - need a starting point
- Next by Date: Re: what is wrong with my script
- Previous by thread: DBI::st=HASH(0x88f6520)
- Next by thread: Re: what is wrong with my script
- Index(es):
Relevant Pages
|