1 package MooseX::Runnable::Run;
2 # ABSTRACT: Run a MooseX::Runnable class as an application
6 use MooseX::Runnable::Invocation;
8 sub run_application($;@) {
11 exit MooseX::Runnable::Invocation->new(
16 sub run_application_with_plugins($$;@){
17 my ($app, $plugins, @args) = @_;
18 exit MooseX::Runnable::Invocation->new(
25 my ($class, $app) = @_;
28 run_application $app, @ARGV;
33 *{ $c. '::run_application' } = \&run_application;
34 *{ $c. '::run_application_with_plugins' } = \&run_application_with_plugins;
49 use Moose; with 'MooseX::Runnable';
50 sub run { say 'Hello, world.'; return 0 } # (UNIX exit code)
52 Write a wrapper script, C<myapp.pl>. With sugar:
55 use MooseX::Runnable::Run 'MyApp';
60 use MooseX::Runnable::Run;
62 run_application 'MyApp', @ARGV;
73 This is a utility module that runs a L<MooseX::Runnable|MooseX::Runnable> class with
74 L<MooseX::Runnable::Invocation|MooseX::Runnable::Invocation>.
78 L<mx-run>, a script that will run MooseX::Runnable apps, saving you