Re: How do I arrange for Makefile.PL to create a modulino instance script?

2012-09-04 Thread David Cantrell
On Sat, Sep 01, 2012 at 01:40:01AM -0700, Buddy Burden wrote:
  It's fairly unusually for a piece of code to be appropriate both as a
  stand-alone program and as a module loaded by other programs. ...
 Perhaps David's original question would have been more clear with a
 slightly more targeted footnote reference:
 http://www.drdobbs.com/scripts-as-modules/184416165
 
 Not saying that I agree that such things belong on CPAN (or that I
 agree that they don't), but I understand the point of the exercise at
 least.

The normal way to put such things on the CPAN (mostly because it's the
way that plays nicely with the tools that we all use to install things
from the CPAN) is something like this:
  
https://github.com/DrHyde/perl-modules-CPAN-FindDependencies/blob/master/examples/cpandeps
  
https://github.com/DrHyde/perl-modules-CPAN-FindDependencies/blob/master/lib/CPAN/FindDependencies.pm

-- 
David Cantrell | A machine for turning tea into grumpiness

  Irregular English:
you have anecdotes; they have data; I have proof


Re: How do I arrange for Makefile.PL to create a modulino instance script?

2012-09-04 Thread Smylers
Buddy Burden writes:

 Guys,
 
  It's fairly unusually for a piece of code to be appropriate both as
  a stand-alone program and as a module loaded by other programs. ...
 
 Perhaps David's original question would have been more clear with a
 slightly more targeted footnote reference:
 http://www.drdobbs.com/scripts-as-modules/184416165

Thanks. Yes, I was unaware of that.

But ... I'm not still not clear on the advantage of having the run
function and the if caller test be in the module itself, rather than a
separate file which use-s the module.

Apart from anything else, it seems hard to come up with a filename which
makes both a good command name for users and works well as module name
in a use line by something else which wants to use the module.

Cheers

Smylers
-- 
http://twitter.com/Smylers2


How do I arrange for Makefile.PL to create a modulino instance script?

2012-08-31 Thread David Christensen

module-authors:

I am working on a modulino [1] and would like to use ExtUtils::MakeMaker 
to generate a Makefile such that make (or make all) copies the 
module file (lib/MyModulino.pm) to a script file 
(perl-bin/mymodulino.pl) and sets the  execute bit.



Any suggestions?


TIA,

David



References:

[1]  d foy, brian, 2007, Mastering Perl, O'Reilly Media, 
http://shop.oreilly.com/product/9780596527242.do





Re: How do I arrange for Makefile.PL to create a modulino instance script?

2012-08-31 Thread Leon Timmermans
On Fri, Aug 31, 2012 at 3:29 PM, David Christensen
dpchr...@holgerdanske.com wrote:
 module-authors:

 I am working on a modulino [1] and would like to use ExtUtils::MakeMaker to
 generate a Makefile such that make (or make all) copies the module file
 (lib/MyModulino.pm) to a script file (perl-bin/mymodulino.pl) and sets the
 execute bit.


 Any suggestions?

Why do you want to do this? I can see absolutely no reason why this
would be preferable over a traditional module/script split *in a CPAN
distribution* (which doesn't mean they can't be useful in other
situations). The system does not look for executables in the same
place as perl looks for modules, this sounds to me like you're only
making things more complicated for yourself.

Leon