View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Philip Crow > Bigtop > docs/keyword_cookbook/controller/gen_uses/discussion


Annotate this POD


New  3
Open  1
View/Report Bugs


If your generated controller module needs to load a module, include a gen_uses statement in your controller's block.

gen_uses takes a comma separated list of modules to use. If you want to control their import lists, use pairs. For example, this will use the modules with default importing:

    gen_uses Your::Module, Some::Other::Module;

Add pairs to get the imports of your dreams:

    gen_uses Your::Module => `qw( :everything :and then some )`;

Note that the value will be used literally to produce this:

    use Your::Module qw( :everything :and then some );

So, qw is a good choice (as it usually is).

See also stub_uses, uses, and plugins. The later is likely the only good choice, if the module you want to use is a Gantry plugin.


Build the example with:

    bigtop -c example.bigtop all

Look for Exotic in lib/Kids/GEN/ Notice how Your::Module lists imports explicitly. If you don't provide a list, all of the @EXPORT items will be explicitly listed.

syntax highlighting: