The current directory ./ dotSlash is a handy shortcut that isn't guaranteed to refer the same directory everytime you run the script. If you try changing directory on the command line and then calling the script you would find the same problem.
You either have to tell the script the absolute path of the file to open
(thats the clearest thing to do), guess the directory that cron considers its current working directory when executing perl scripts
(you can discover this if you are interested by making your script write the results of `pwd` to an absolute filename for you to check later), or get your script to manually force itself to run from the place you want to represent with ./ by the command:
chdir ("/absolute/Path/Name/forYourDir"); # . is set
In short you must tell the script what . means, unless you only ever want to run it yourself from somewhere you will always be in when you do, or you know what the script will think it means and thats fine with you.
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.