Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

building a module with executable scripts

by rmcgowan (Sexton)
on Dec 18, 2013 at 20:47 UTC ( [id://1067704]=perlquestion: print w/replies, xml ) Need Help??

rmcgowan has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to create a module which will include a number of stand alone scripts that used the module files. My understanding from looking at the ExtUtils::MakeMaker POD, as well as some examples from CPAN, I should be able to do this by using this in Makefile.PL:

use 5.012001; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'MyModule', VERSION_FROM => 'lib/MyModule.pm', PREREQ_PM => {'WWW::Curl::Easy' => 4.15, 'JSON::XS' => 2.32, 'Term::ReadKey' => 2.30, 'String::Strip' => 1.02, 'Date::Parse' => 2.30, }, ABSTRACT_FROM => 'lib/MyModule.pm', AUTHOR => 'me <me@example.com>', EXE_FILES => [ 'script_name' ], );

But when I run 'make dist', the verbose output from 'tar' does not include 'script_name', and extracting the tar file content does not include it (just being sure ;).

Yet the examples I've looked at don't seem to be doing anything more than the single EXE_FILES line.

What am I missing? Many thanks in advance.

Replies are listed 'Best First'.
Re: building a module with executable scripts
by davido (Cardinal) on Dec 18, 2013 at 20:49 UTC

    Did you add 'script_name' to the distribution's MANIFEST file?


    Dave

      Nope. ;(

      So I added it and all is fine. Thank you.

        At the shell prompt:  $ make distcheck will spew a list of files in the distribution's hierarchy that aren't in MANIFEST, except for those files that are skipped by default, or explicitly with MANIFEST.SKIP.


        Dave

Re: building a module with executable scripts
by taint (Chaplain) on Dec 19, 2013 at 01:36 UTC
    Greetings, rmcgowan.

    Using the example you provided. I'll propose some possible changes/additions

    use 5.012001; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'MyModule', VERSION_FROM => 'lib/MyModule.pm', EXE_FILES => ['script_name'], PL_FILES => {}, PREREQ_PM => {'WWW::Curl::Easy' => 4.15, 'JSON::XS' => 2.32, 'Term::ReadKey' => 2.30, 'String::Strip' => 1.02, 'Date::Parse' => 2.30, }, ABSTRACT_FROM => 'lib/MyModule.pm', AUTHOR => 'me <me@example.com>', # EXE_FILES => [ 'script_name' ], );
    Note the addition, and position of EXE_FILES, and PL_FILES. This is normally how/where such things are added/used. I have no idea where your EXE file is, or if it's even a EXE type file. Same goes for the PL file. Is it a Perl script you are attempting to include? Where is it located within the Module tree? In the root? In a "script" directory off root? These are things you'll need to know, in order to accomplich your goal.

    HTH, and best wishes.

    --Chris

    Yes. What say about me, is true.
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1067704]
Approved by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (None)
    As of 2024-04-25 00:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found