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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

If you are using ExtUtils::MakeMaker, you can prompt the user for an installation location (or just set it yourself). To actually install that stuff using the usual Makemaker sequence, you add some makefile rules.

Makemaker uses the My:: namespace to allow you to add extra stuff (or override things) that Makemaker will output. You just need to add the stuff to install your templates.

The targets in the makefile are double-colon targets, so you can add to their definition. From the postamble(), return the string you want Makemaker to add to the makefile.

{ package MY; sub postamble { return <<"HERE"; all :: template_all install :: template_install template_all :: ...dependencies... # ...commands to run to make templates template_install :: ...dependencies... # ...commands to install templates HERE } }

Makemaker has a lot more features like this, too. The best way to find out about them is to look at other people's Makefile.PL. The complicated modules should have interesting examples that you can re-use. Once you get the hang of it, you can do some pretty powerful things.

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

In reply to Re: Including TT2 templates in module distributions by brian_d_foy
in thread Including TT2 templates in module distributions by matthewb

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2024-04-18 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found