what is wrong with my script



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();

print

$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
.



Relevant Pages

  • Re: Cant get Sudo.pm to run my command but it works from a prompt
    ... I have the following in a CGI script: ... Show us the sudoers file using cat -etu "file". ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • Stopping a Service with cgi
    ... I have set a setuid for the cgi script and the script ... ../file-name.cgi will stop the httpd but i want to stop ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • Re: Stopping a Service with cgi
    ... I want to start and stop a serviec using cgi script. ... Say mysql service will do, ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • RE: 501 Protocol scheme http is not supported
    ... Its not the error with the perl script. ... Please let me know if you ran it as a cgi script after ... Do You Yahoo!? ... Mail has the best spam protection around ...
    (perl.beginners)
  • Re: what is wrong with my script
    ... I have a CGI script to process some data from the ... The input data takes this format(row x ... should fix your formatting problems. ...
    (perl.beginners)