Student needs help with (I think)

Discussion in 'Perl Misc' started by Gary Schenk, Sep 25, 2003.

  1. Gary Schenk

    Gary Schenk Guest

    I'm using this script to get data from a HTML form. All I get is an error:
    premature end of script headers.

    This is run on a shared hosting web site. Could this be a problem with I'm very new, and have read this over carefully, so it must be a
    configuration problem. I realize you guys can't help with that, but could
    you tell me if the script is OK?

    #!/usr/bin/perl -wT
    use strict;
    use CGI qw:)standard);
    use CGI::Carp qw(fatalsToBrowser);
    print header;
    print dump();

    The Carp module is on the server, and the permissions are correct on the
    script. a "locate" command shows that is on the server, also.

    Gary Schenk, Sep 25, 2003
    1. Advertisements

  2. Gary Schenk

    Sam Holden Guest

    dump() is a perl built in function that causes the process to dump core.

    Calling it will naturally make you script not work.

    So why are you calling it? Case matters.

    Also, run the script at the command line to get it working before
    running it via CGI, any errors will be much easier to see.
    Sam Holden, Sep 25, 2003
    1. Advertisements

  3. Gary Schenk

    Gary Schenk Guest

    Long story, but I'm having to teach myself Perl and CGI. I'm taking an
    extended education class starting next week. In the meantime I've been
    reading a book on CGI and Perl. This is an example script from the book. It
    is supposed to output a webpage with information taken from a form. This
    script is to show how easy makes this task. Basically, I'm quite
    ingnorant, and want to know if it is the script or a configuration problem.
    Yes, I ran perl -c and got the "too late for -T option" message. Maybe i am
    being impatient, but it's bugging me.
    Gary Schenk, Sep 25, 2003
  4. Gary Schenk

    Sam Holden Guest

    [snip CGI script calling dump()]
    Are you *sure* the book doesn't say:

    print Dump();

    Since that would do what you describe.

    As I said, case matters.

    If it really says dump(), then I'd be looking for an errata and making
    the corrections it specifies. If there isn't one I'd be looking for a
    new book.
    So use perl -c -T.

    See 'perldoc perldiag' if you don't understand a perl diagnostic.

    Though what I meant was:


    Or whatever the CGI was named, to run it on the command line.
    Sam Holden, Sep 25, 2003
  5. Gary Schenk

    Gary Schenk Guest

    It definitely says print dump();
    Of course, you are absolutely correct! That was it. It runs as it should
    I checked for an errata and nothing there. I'll send an email to the
    Thanks for the tip.
    I see.

    Thanks for the help. Lots of information was packed into this exchange!
    Gary Schenk, Sep 25, 2003
    Hash: SHA1

    Which book are you using? Lord knows there are enough bad Perl books out
    there. :-/
    - --
    $_ = reverse sort $ /. r , qw p ekca lre uJ reh
    ts p , map $ _. $ " , qw e p h tona e and print

    Version: PGPfreeware 7.0.3 for non-commercial use <>

    -----END PGP SIGNATURE-----
    Eric J. Roode, Sep 25, 2003
  7. Gary Schenk

    Gary Schenk Guest

    Eric J. Roode wrote:


    "Writing CGI Applications with Perl". I've just started it, along with
    "Learning Perl".
    Gary Schenk, Sep 26, 2003
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.