fix bug that allowed forwarded logs to be output from the logger built via env vars
[scpubgit/Object-Remote.git] / lib / Object / Remote / Proxy.pm
1 package Object::Remote::Proxy;
2
3 use strictures 1;
4 use Carp qw(croak);
5
6 sub AUTOLOAD {
7   my $self = shift;
8   (my $method) = (our $AUTOLOAD =~ /([^:]+)$/);
9   my $to_fire = $self->{method};
10   if ((caller(0)||'') eq 'start') {
11     $to_fire = "start::${to_fire}";
12   }
13   
14   unless ($self->{remote}->is_valid) {
15     croak "Attempt to use Object::Remote::Proxy backed by an invalid handle";
16   }
17   
18   $self->{remote}->$to_fire($method => @_);
19 }
20
21 sub DESTROY { }
22
23 1;