1#line 1
2package Module::Install::Base;
3
4$VERSION = '0.84';
5
6# Suspend handler for "redefined" warnings
7BEGIN {
8	my $w = $SIG{__WARN__};
9	$SIG{__WARN__} = sub { $w };
10}
11
12### This is the ONLY module that shouldn't have strict on
13# use strict;
14
15#line 41
16
17sub new {
18	my ($class, %args) = @_;
19
20	foreach my $method ( qw(call load) ) {
21		next if defined &{"$class\::$method"};
22		*{"$class\::$method"} = sub {
23			shift()->_top->$method(@_);
24		};
25	}
26
27	bless( \%args, $class );
28}
29
30#line 62
31
32sub AUTOLOAD {
33	my $self = shift;
34	local $@;
35	my $autoload = eval {
36		$self->_top->autoload
37	} or return;
38	goto &$autoload;
39}
40
41#line 79
42
43sub _top {
44	$_[0]->{_top};
45}
46
47#line 94
48
49sub admin {
50	$_[0]->_top->{admin}
51	or
52	Module::Install::Base::FakeAdmin->new;
53}
54
55#line 110
56
57sub is_admin {
58	$_[0]->admin->VERSION;
59}
60
61sub DESTROY {}
62
63package Module::Install::Base::FakeAdmin;
64
65my $fake;
66sub new {
67	$fake ||= bless(\@_, $_[0]);
68}
69
70sub AUTOLOAD {}
71
72sub DESTROY {}
73
74# Restore warning handler
75BEGIN {
76	$SIG{__WARN__} = $SIG{__WARN__}->();
77}
78
791;
80
81#line 157
82