X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FProxy.pm;h=68706bddff69d8f9bdb22f59cda96522cfbe8505;hb=abef6e5b046572e5130c41ce62d7dde01978562f;hp=a3e2a805b70feac24c15dddfc2b8a680d8ab2fcf;hpb=9d804009b5363c739598a9cc4507df57a2d59c55;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/Proxy.pm b/lib/Object/Remote/Proxy.pm index a3e2a80..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}->call($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 { }