This file is indexed.

/usr/share/perl5/MooseX/Runnable/Run.pm is in libmoosex-runnable-perl 0.03-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package MooseX::Runnable::Run;
use strict;
use warnings;

use MooseX::Runnable::Invocation;

sub run_application($;@) {
    my ($app, @args) = @_;

    exit MooseX::Runnable::Invocation->new(
        class => $app,
    )->run(@args);
}

sub run_application_with_plugins($$;@){
    my ($app, $plugins, @args) = @_;
    exit MooseX::Runnable::Invocation->new(
        class => $app,
        plugins => $plugins,
    )->run(@args);
}

sub import {
    my ($class, $app) = @_;

    if($app){
        run_application $app, @ARGV;
    }
    else {
        my $c = caller;
        no strict 'refs';
        *{ $c. '::run_application' } = \&run_application;
        *{ $c. '::run_application_with_plugins' } = \&run_application_with_plugins;
    }
}

1;

__END__

=head1 NAME

MooseX::Runnable::Run - run a MooseX::Runnable class as an application

=head1 SYNOPSIS

Write an app:

   package MyApp;
   use Moose; with 'MooseX::Runnable';
   sub run { say 'Hello, world.'; return 0 } # (UNIX exit code)

Write a wrapper script, C<myapp.pl>.  With sugar:

   #!/usr/bin/env perl
   use MooseX::Runnable::Run 'MyApp';

Or without:

   #!/usr/bin/env perl
   use MooseX::Runnable::Run;

   run_application 'MyApp', @ARGV;

Then, run your app:

   $ ./myapp.pl
   Hello, world.
   $ echo $?
   0

=head1 DESCRIPTION

This is a utility module that runs a L<MooseX::Runnable|MooseX::Runnable> class with
L<MooseX::Runnable::Invocation|MooseX::Runnable::Invocation>.

=head1 SEE ALSO

L<mx-run>, a script that will run MooseX::Runnable apps, saving you
valuable seconds!

L<MooseX::Runnable>