Thanks for your reply. I did checked again and corrected few things and the table is created now. But I am facing a issue.
I am reading data from a file, processing it and then trying to put the data in table accordingly. Table has 40 rows and 3 columns. Below is the code:
#!C:\perl\bin\perl.exe use strict; use CGI; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use HTML::Table; my $linecount=0; open(FILE,"details.txt")or die("Sorry can't open $!\n"); my $cgi=CGI->new; print $cgi->header; print $cgi->start_html("Test display page"); print $cgi->h3("Testing the output format"); my $table = new HTML::Table(-rows=>40, -cols=>3, -align=>'left', -border=>1, -width=>'30%', -padding=>5, -head=> ['col1','col2','col3']); OUTER: while(my $line = <FILE>) { chomp($line); my @field=split(/\s+/,$line); for(my $j=1;$j<=24;$j++) { $table->setCell($linecount, $j, $field[($j-1)]); } $linecount++; } close(FILE); print $table->getTable; print $cgi->end_html;
It's printing the columns but data's are not coming somehow. When run the code without html it displays the data. Please help to know where I am going wrong.
Thanks, sir_comIn reply to Re: CGI problem help
by sir_com
in thread CGI problem help
by sir_com
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |