X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FProxy.pm;h=18e8436ddb966cc77d674cdc6759d937d68a72e3;hb=de9062cfef7f98d0efc01b114328959f2f84ada4;hp=b2ae3c69f4a9480233bb797c1d3efae7492fd159;hpb=9e72f0cf54e92bccdba71eb75037f1cfe4f69f36;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/Proxy.pm b/lib/Object/Remote/Proxy.pm index b2ae3c6..18e8436 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->{handle}->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 { }