Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Premature Error using CGI.pm

by aardvark (Pilgrim)
on Feb 24, 2001 at 13:35 UTC ( [id://60642]=note: print w/replies, xml ) Need Help??


in reply to Premature Error using CGI.pm

CGI error debugging can get really whacky. I feel your pain.
I would try breaking that one long print statement into several smaller print statements.
Maybe then you can get a more meaningful error.

You are using the standard syntax when you might want to try the object-oriented syntax,
Try ...
my $cgi = new CGI; print $cgi->header(), $cgi->start_html('Test the boundaries of Relaxation'), $cgi->p('Hello Weekend'), $cgi->end_html;
Also, are you sure you want your shebang line(#!) to be:
#!/user/bin/perl -wT
and not
#!/usr/bin/perl - wT

I hope this helps.
Get Strong Together!!

BTW - does anybody know why a shebang of:
#!/user/local/bin/perl
works on my machine?
I have no /user directory, so I would expect an error, but I got none. Is something going on under the hood?

Replies are listed 'Best First'.
Re: Re: Premature Error using CGI.pm
by Masem (Monsignor) on Feb 24, 2001 at 17:22 UTC

    BTW - does anybody know why a shebang of:
    #!/user/local/bin/perl
    works on my machine? I have no /user directory, so I would expect an error, but I got none. Is something going on under the hood?

    Assuming you're talking about Apache, it doesn't use the first line, but instead relies on file types that are set up in the configuration file to determine what type of file a request is, and so as long as it's named "something.pl", it doesn't matter to Apache what the first line is. Of course, if you run it from the command line, you'll get the unknown file error.

      Assuming, of course, you're on win32. I think both win32 and apache/win32 use the shebang line for command line options (-wT of course), but not to find the perl exe. On my unix (Solaris/Linii) boxen, a bad shebang path doesn't run, command line or cgi. On win32, it doesn't matter. Does YMV?.

      a

        On every platform, Perl uses the #! line to get options. But if Perl is the first one to get the -T option from the #!, then -T won't work (you'll get the "too late" error). Win32 doesn't use the #! at all. I've heard that Apache can be configured either way on Win32, but by default uses the #! line (and that agrees with my limited experience).

                - tye (but my friends call me "Tye")

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-20 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found