FAQ

On 2012.11.30 6:04 PM, David Christensen wrote:
I want one file that can be used:

1. As a module (*.pm) and as a script (executable *.pl, or just executable
base name with no extension) on machines where I want to install Perl modules;
and

2. As a stand-alone script on machines where I don't want to install Perl
modules.
To solve 1 I would suggest doing what most of the App::* modules do. Put all
the logic into the .pm file and make the program a thin wrapper around it.
App::Ack for example. https://metacpan.org/release/ack This is far simpler
to write for, use and test.

For 2 you can use App::Fatpacker to generate the stand alone version. This is
what cpanminus does. The advantage is you are not limited to a single .pm
file and it handles dependencies.
https://metacpan.org/module/App::FatPacker
https://metacpan.org/source/MIYAGAWA/App-cpanminus-1.5018/bin/cpanm

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 5 | next ›
Discussion Overview
groupmakemaker @
categoriesperl
postedAug 25, '12 at 11:04p
activeDec 1, '12 at 6:56p
posts5
users2
websitemetacpan.org...

People

Translate

site design / logo © 2017 Grokbase