Commit | Line | Data |
---|---|---|
9e72f0cf | 1 | package Object::Remote::Proxy; |
2 | ||
3 | use strictures 1; | |
5add5e29 | 4 | use Carp qw(croak); |
9e72f0cf | 5 | |
6 | sub AUTOLOAD { | |
7 | my $self = shift; | |
8 | (my $method) = (our $AUTOLOAD =~ /([^:]+)$/); | |
3f1f1e66 | 9 | my $to_fire = $self->{method}; |
dc28afe8 | 10 | if ((caller(0)||'') eq 'start') { |
3f1f1e66 | 11 | $to_fire = "start::${to_fire}"; |
dc28afe8 | 12 | } |
55c0d020 | 13 | |
5add5e29 | 14 | unless ($self->{remote}->is_valid) { |
15 | croak "Attempt to use Object::Remote::Proxy backed by an invalid handle"; | |
16 | } | |
55c0d020 | 17 | |
3f1f1e66 | 18 | $self->{remote}->$to_fire($method => @_); |
9e72f0cf | 19 | } |
20 | ||
21 | sub DESTROY { } | |
22 | ||
23 | 1; |