X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FProxy.pm;h=68706bddff69d8f9bdb22f59cda96522cfbe8505;hp=8541056920c8c711d7846f31eb168ebea1bf4147;hb=5add5e29851e82862e4d8f6d67dfce559f6685ce;hpb=2065b08ba567dbf8c8370b69e3f5b2aa145efe23 diff --git a/lib/Object/Remote/Proxy.pm b/lib/Object/Remote/Proxy.pm index 8541056..68706bd 100644 --- a/lib/Object/Remote/Proxy.pm +++ b/lib/Object/Remote/Proxy.pm @@ -1,11 +1,21 @@ package Object::Remote::Proxy; use strictures 1; +use Carp qw(croak); sub AUTOLOAD { my $self = shift; (my $method) = (our $AUTOLOAD =~ /([^:]+)$/); - $self->{remote}->${\$self->{method}}($method => @_); + my $to_fire = $self->{method}; + if ((caller(0)||'') eq 'start') { + $to_fire = "start::${to_fire}"; + } + + unless ($self->{remote}->is_valid) { + croak "Attempt to use Object::Remote::Proxy backed by an invalid handle"; + } + + $self->{remote}->$to_fire($method => @_); } sub DESTROY { }