When I write programs, I normally start with simple things, such as running the program with no arguments. I am guessing you looked at App::Cronjob? The manpage is not of much help, there are no /examples, and the only test doesn't show anything useful. It was not obvious to me, how the heck one uses this module. I have learned a lot since I posted this, and I am currently trying to figure out why it can't find sendmail, when exim has provided sendmail.

It may be that all of my problems were due to insufficient documentation. That I had these problems may be due to insufficient error trapping in the modules. Had all of the code been more "obvious", I may not have run into this. I am just trying to find a better way to solve these problems should they occur in the future with other CPAN modules. At this point, I have not enough experience with how these modules actually work to know if they are doing what I would like them to do or not.

What seems to be needed, is that the entire perl program needed is:

#!/usr/bin/perl use App::Cronjob; App::Cronjob::run();

Is this supposed to be obvious? Looking at Cronjob.pm, I thought I needed to provide a hash to run(), to provide the values. That triggered the symbolic reference problem. Allowing symbolic references shifted the problem to $main::1() not found. Putting a bunch of command line stuff (such as --subject="No Subject") into @ARGV, I don't think worked (does @ARGV lose its magic, if the location of the list changes?) Pushing my arguments onto @ARGV at least let me get past this symbolic reference problem. Fine, I've now run into this thing about sendmail. I suspect I will soon have some documentation as to how to use this module, which looks to be a good solution to a problem in mu LUG. So, I am slowly getting to find how to use this module on my own. That isn't the problem I am asking about. How the heck does one find this kind of problem, and how do you solve it in the future? I looked at the bug reports and test matrix for G::L::D, and seen nothing which would indicate there was a problem. When I write usage messages, they are pretty simple. I have never run across code remotely like what G::L::D was doing. I never would have expected code like that to behave how I seen it behave. Maybe this is just a problem for people who run similar code inside emacs using perldb? Does it depend only on the original @ARGV (or things pushed onto @ARGV)? Can we unshift things onto @ARGV instead? Am I making sense? Thanks.


In reply to Re^2: Usage message, and App::Cronjob by Anonymous Monk
in thread Usage message, and App::Cronjob by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.