What happens when you try to run it the way you want to run it?
Sometimes I've seen scripts fail because the shebang line has a trailing carriage return. You can find this if you run it through "od" or some other hex dump program.
$ head -1 good.pl | od -c
0000000 # ! / u s r / b i n / p e r l \n
0000020
$ head -1 bad.pl | od -c
0000000 # ! / u s r / b i n / p e r l \r
0000020 \n
0000021
You can strip out the carriage returns using perl this way:
perl -pi.bak -e 's/\r//g' my_script.pl
If the script is supposed to have some carriage return in it, this will break it, but that's unusual. If it causes a problem, the above line creates a .bak file that you can revert to.
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.