Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

error @ line7

by Monk_perl
on Mar 07, 2013 at 11:10 UTC ( #1022198=perlquestion: print w/ replies, xml ) Need Help??
Monk_perl has asked for the wisdom of the Perl Monks concerning the following question:

If the following cgi script runs on your server please reply otherwise tell me how those errors can be resolved?

#!C:\perl\bin\perl -w use strict; use CGI; use diagnostics; my $query = new CGI; print << 'EOF'; print "Content-type: text/html\n\n"; <html> <head> <title>My First CGI Script</title> </head> <body bgcolor="#FFFFCC"> <h1>This is a pretty lame Web page</h1> <p>Who is this Ovid guy, anyway?</p> </body> </html> EOF

Comment on error @ line7
Download Code
Re: error @ line7
by CountZero (Bishop) on Mar 07, 2013 at 11:12 UTC
    And the question is?

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re: error @ line7
by marto (Chancellor) on Mar 07, 2013 at 11:20 UTC

    Frankly you're wasting our time and yours. You've been asking for days about some CGI problem and provided no details. This code doesn't run, when you try to run it tells you where the problem is. You've taken a copy of code from Ovid's CGI Course, but haven't bothered to read any of the text:

    A bad example
    Let's just jump write (sic) in! The first program you are about to see is coded in a style which is, unfortunately, all too common on the web. Here's what your first CGI script should not be!:

    As well as ignoring this warning, and the rest of the article, you add your own code which stops the example of bad code from running. Thankfully you've added use strict; use warnings; use diagnostics; so you're already aware of what the problem is. You need to read the CGI documentation, and actually read, learn and understand the tutorial you're currently ignoring and it's examples you are subsequently breaking. Make your code the same as the example if you insist on ignoring the warnings in the tutorial.

    Make some effort when posting, once again How do I post a question effectively?, this is displayed each time you post. If you ignore the advice I give on perl or posting here once more I won't respond again.

    Update: remove line 67 of your code. Learn basic perl: New to perl

Re: error @ line7
by daxim (Chaplain) on Mar 07, 2013 at 11:38 UTC
    With CGI, you are learning an obsolescent technology. A Web program in the year 2013 looks like that:
    use strict; use diagnostics; my $html = <<'HTML'; <!DOCTYPE html> <html> <head> <title>My First PSGI Script</title> </head> <body> <h1>This is a pretty lame Web page</h1> <p>Who are these perlmonks, anyway?</p> </body> </html> HTML my $app = sub { return [ 200, ["Content-Type" => 'text/html'], [$html] ] };
    Save it as app.psgi, run it with plackup.
Re: error @ line7 (basic debugging checklist)
by Anonymous Monk on Mar 07, 2013 at 13:36 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1022198]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2014-08-02 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (55 votes), past polls