/usr/share/perl5/Module/CPANfile/Environment.pm is in libmodule-cpanfile-perl 1.0002-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 | package Module::CPANfile::Environment;
use strict;
use warnings;
use Module::CPANfile::Result;
use Carp ();
my @bindings = qw(
on requires recommends suggests conflicts
feature
osname
configure_requires build_requires test_requires author_requires
);
my $file_id = 1;
sub new {
my($class, $file) = @_;
bless {
file => $file,
}, $class;
}
sub bind {
my $class = shift;
my $pkg = caller;
my $result = Module::CPANfile::Result->new;
for my $binding (@bindings) {
no strict 'refs';
*{"$pkg\::$binding"} = sub { $result->$binding(@_) };
}
return $result;
}
sub parse {
my($self, $code) = @_;
my($res, $err);
{
local $@;
$file_id++;
$res = eval <<EVAL;
package Module::CPANfile::Sandbox$file_id;
no warnings;
my \$_result;
BEGIN { \$_result = Module::CPANfile::Environment->bind }
# line 1 "$self->{file}"
$code;
\$_result;
EVAL
$err = $@;
}
if ($err) { die "Parsing $self->{file} failed: $err" };
return $res;
}
1;
|