logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: [Module::Build] newbie question about custom actions: msg#00021

Subject: Re: [Module::Build] newbie question about custom actions
Tim Mooney wrote:
[I'm not subscribed to module-build-general, please Cc: me on replies]

All-

I've searched and browsed the module-build-general archives and skimmed
the pod for Module::Build and Module::Build::Cookbook, and still don't see
how to do something that should be "simple".

How do I do the equivalent of (in Makefile-ese):

PERL=/path/to/perl
SOME_CMD=/path/to/some/command

...

subs :    lib/My/Module.pm
    $(PERL) -pi -e "s/@SOME_CMD@/$(SOME_CMD)/" $<

build: subs
    ...continue regular build rule here




In other words, I want a custom action that substitutes the path to some
command in place of @SOME_CMD@ in my module.  I want the default build
(really the code) action to happen as normal, but it should depend on
my custom subs action happening first.

Without completely overriding the default code action, I don't see any
obvious way to do this.  Is this the kind of thing normally handled by
a .PL file?

Yes. Write your module as an executable perl script that produces as output the modified final version of the module and name it with a .PL extension.

See the description of the PL_files parameter to the Module::Build->new() constructor in the docs.

Randy.


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click


<Prev in Thread] Current Thread [Next in Thread>