Just three more questions, your honor...
The script executes with
perl checkvars.cgi, but does it execute with just
./checkvars.cgi?
Also, are you on a Linux/Unix server?
Are you coding on the server or coding remotely and transfering the file?
"Of course, your honor, I am leading the witness." If the above answers are No, Yes, and remotely (with Win32), then read on, you might be running into a ^M problem. If not, then ignore the following.
If you've transfered the files from Win32 to Linux/Unix via FTP, there is a chance that the extra ^M used on Win32 as a line seperator followed your files over. You can test this by opening your file in VI's binary mode (vi -b file or vim -b file). If you see ^M at the end of each line, that is the problem. The magic #! can not find /usr/bin/perl^M. The main reason I'm suggesting this as the problem is that a friend at work recently had the same symptoms and a binary FTP was the culpret. Try sending the file again via FTP in ascii mode (just type ascii at the FTP prompt). Or within VI (or VIM) type
:%s/^M//g To type the ^M, type
<Ctl>VM.
Cheers!
Casey
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.