This perl script works in two browsers.
--------
#!/usr/bin/perl -w use CGI; my $q = new CGI; print $q->header; print "<CENTER><H1>Show me the monkey!</H1></CENTER><BR>"; print $q->end_html;
This one does NOT work in either Netscape or Konquerer.
#!/usr/bin/perl -w # CGI to select data from a SQL database use CGI; # use strict; my $co = new CGI; print $co->header; print "<CENTER><H1>CGI Environment Variables Example</H1></CENTER><BR> +"; # print $co->start_html(-title=>'CGI Environment Variables Example', # -BGCOLOR=>'black', # -TEXT=>'white'); # print $co->center($co->h1('CGI Environment Variables Example')); # foreach my $key (sort keys %ENV) { # print $co->b("$key=>$ENV{$key}"), # $co->br; # } print $co->end_html;
---------------------
But it DOES execute at the O/S, as in #perl checkvars.cgi. The error in the browser is "Premature end of script headers", Error 500. Aren't these basically IDENTICAL?!? What is REALLY sad is that I've been working on scripts taken right straight out of books today and none of them work for me accept this lame "Show me the Monkey". This last one is from the "Perl Black Book", pages 1178-1179 and all I have done it comment out lines to try to reduce it to the ridiculously simple but it still doesn't work for me! Any help, as usual is gratefully appreciated.

Andrew Lietzow

Format tweeks - dvergin 2002-05-16

Edit kudra, 2002-05-17 Changed title


In reply to Browser compatibility problem by alietzow

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.