in reply to Perl Setup on Mandrake 9.1

First question: What do you get when you run it from the command line?

Second question: Did you create this file on the box, or did you upload it from a Windows machine? If the latter, did you sent it as a binary or as a text file? In the case of a text file, line endings are translated appropriately, whereas as a binary file it is sent as-is. An easy way to make sure this isn't the issue is to do the following:

perl -p -i.bak -e "s/\r//g" filename
This will create a backup of the file with the extension .bak, and remove the characters, if it is the case.

Third thought: Add the line $| = 1; after your use strict; line. This will turn off output buffering, and save you headaches later.

Are there any additional clues in the apache error_log?

If the above don't help, then I would suggest you do an ls -l /usr/bin/perl from the command line, which will show you if /usr/bin/perl is actually a symbolic link elsewhere.

Hope that helps....

Replies are listed 'Best First'.
Re^2: Perl Setup on Mandrake 9.1
by heroin_bob (Sexton) on Jun 15, 2004 at 17:15 UTC
    When I run it inline I get (paraphrasing because I won't have access to my box until tonight) "error in syntax at line 4 near 'Content-type: text/html...' Compilation aborted errors"

    In response to Q2: I created the file on the box via ssh from my windows machine.

    In response to Q3: I checked the apache log and the only message I received was "Premature end of headers" which had me spinning in circles for a while trying to figure out what my print's weren't coming through.

    I tried what you suggested as well, and it is in fact a symbolic link. It links to a second symbolic link called "perl5", which in turn links to an executable script "perl5.8.0". could this be the cause of my troubles... should I be using "#!/usr/bin/perl5.8.0"? Thanx for your reply!

    "If you're ever lost and need directions, ask the guy on the motorcycle."