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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I can run scripts from one book but I can't from the other book.

That should be pretty easy to troubleshoot. What are the differences in the html between the two books? Specifically, you should examine the form's action attribute in the html. Any differences in the paths listed there? Can you use one book's html with the other book's working perl script?

What are the differences in the perl scripts between the two books? Do both books use script names that have the same extension: .cgi v. .pl? Your server may look at a file's extension to decide whether a file is a perl script and should be executed or whether the file should be returned as text.

What server are you using?

Did you make both your perl scripts executable? $ chmod a+x prog.pl

You might need this shebang line:

#!/usr/local/env perl

When you are testing any cgi script, you should send errors to the browser by adding this line:

use CGI::Carp qw(fatalsToBrowser);

Otherwise, your perl script will fail silently, and you will have to check your server's logs to discover the error.

What does your server's log file say? Find out where it is located, and look at the last 20 lines or so.

You should always post what error you got, or if you didn't get an error, you should state what you expected to happen, and what actually happened. Do not say, "My program doesn't work. Help!"


In reply to Re: CGI question by 7stud
in thread CGI question by spencerr1

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found