1 package MooseX::Runnable::Run;
5 use MooseX::Runnable::Invocation;
7 sub run_application($;@) {
10 exit MooseX::Runnable::Invocation->new(
15 sub run_application_with_plugins($$;@){
16 my ($app, $plugins, @args) = @_;
17 exit MooseX::Runnable::Invocation->new(
24 my ($class, $app) = @_;
27 run_application $app, @ARGV;
32 *{ $c. '::run_application' } = \&run_application;
33 *{ $c. '::run_application_with_plugins' } = \&run_application_with_plugins;
43 MooseX::Runnable::Run - run a MooseX::Runnable class as an application
50 use Moose; with 'MooseX::Runnable';
51 sub run { say 'Hello, world.'; return 0 } # (UNIX exit code)
53 Write a wrapper script, C<myapp.pl>. With sugar:
56 use MooseX::Runnable::Run 'MyApp';
61 use MooseX::Runnable::Run;
63 run_application 'MyApp', @ARGV;
74 This is a utility module that runs a L<MooseX::Runnable|MooseX::Runnable> class with
75 L<MooseX::Runnable::Invocation|MooseX::Runnable::Invocation>.
79 L<mx-run>, a script that will run MooseX::Runnable apps, saving you