Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

cgi file not printing anything

by rjsaulakh (Beadle)
on Dec 17, 2005 at 12:00 UTC ( #517472=perlquestion: print w/replies, xml ) Need Help??
rjsaulakh has asked for the wisdom of the Perl Monks concerning the following question:

#!/usr/bin/perl use CGI; my $cgi=new CGI; print $cgi->header; #here im using rows module in which i am calculating the no of rows use rows; $count = 0; open (FIN, "data.txt") or die "cant open the file "; while(<FIN>) { $count++ } $totalcount= $count; print "$totalcount \n \n "; #so put all the values inside an array say @total. $no_per_page=3; $total_pages=int((scalar $totalcount) / $no_per_page); print "$total_pages \n \n "; $remainder = (scalar $totalcount) % $no_per_page; if ($remainder) { $total_pages++; print $total_pages; } if($total_pages) { print <<"END"; <table cellpadding="0" cellspacing="0" bor +der="0" width="100%"> <tr> <td class="smtxt"> END print "<b>Page&nbsp;</b>"; for $i (1 .. $total_pages) { if ($i == $page) { print "<b>$i</b>"; } else { print "<a href=\"winner.cgi?page=$i&period=$p +eriod\">$i</a>"; } if ($i != $total_pages) { print "&nbsp;|&nbsp;"; } } print "<!-- '$total_pages' '$remainder' --></td></tr></table>\ +n"; }

Replies are listed 'Best First'.
Re: cgi file not printing anything
by chas (Priest) on Dec 17, 2005 at 12:54 UTC
    I never heard of the "rows" module. Are you sure the spelling is correct with regard to case?
    (Update: And how are you using it? Try perl -c on your script. If there isn't such a module that could be the problem.)
    Maybe you need to specify the full path to "data.txt". You could try use CGI::Carp qw(fatalsToBrowser); to see possible errors.

      i am able to solve this problem

Re: cgi file not printing anything
by reneeb (Chaplain) on Dec 17, 2005 at 23:20 UTC
    use strict; and use warnings; could be very helpful.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://517472]
Approved by fxmakers
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2018-04-19 18:11 GMT
Find Nodes?
    Voting Booth?