Don't ask to ask, just ask | |
PerlMonks |
Re^3: Parallelization of heterogenous (runs itself Fortran executables) codeby blazar (Canon) |
on Nov 21, 2007 at 15:58 UTC ( [id://652156]=note: print w/replies, xml ) | Need Help?? |
Ok, you are mjd so I shouldn't probably "dare" to comment, but...
I personally believe that since we recommend newbies and more expert programmers altogether to always use strict and warnings, and this is a nice little utility likely to be picked up as an example, it would be a good thing if it had
at the top. So to build a better future for our children... Also,
would implement the -r switch straight ahead.
The docs do not say anything about getopts() return value, and indeed experimental evidence is that it can't be relied upon for failure checking. Suitable hooks are provided instead, although admittedly I don't like the interface. (Suitably named subs in main::)
Any good reason for basically reimplementing die? Incidentally, I would have used a here-doc instead. Personally, I like to implement a USAGE sub like thus:
So if the user explicitly asks for help, then I print to STDOUT and exit regularly, for in that case I wouldn't consider the program termination to be "abnormal". Else, I regularly die USAGE.
In Section
Seekers of Perl Wisdom
|
|