in reply to print file in cgi with perl

because this:
do{ $array[$i], $i=$i+1; }while($i<30);
doesn't print anything. Replace that block with this one line:
print for @array;
But first fix this line:
print start_html('A Simple Example'),
You need a semi-colon at the end, not a comma. ;)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: print file in cgi with perl
by hardburn (Abbot) on Jul 23, 2003 at 16:42 UTC

    Since print prints a list, you don't even need the for:

    print @array;

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    Note: All code is untested, unless otherwise stated

Re: (jeffa) Re: print file in cgi with perl
by aroso (Novice) on Jul 23, 2003 at 16:10 UTC
    This solution dont resolve my problem.
    Now dont print anything in monitor.
    #!C:/server/Perl/bin/perl.exe use CGI qw(:standard); use XML::Checker::Parser; use strict; use warnings; my $checker = new XML::Checker; open(INPUT, "dtdversao3.dtd") or die "$!"; my @array=<INPUT>; close(INPUT); my $i=0; print header; print start_html('A Simple Example'); print for @array; print end_html;
      Are you sure about that? :) Remember, DTD's get parsed by the browser - try viewing the source.

      You probably should use dga's excellent suggestion and

      print header('text/plain');
      instead.

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)