X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnection.pm;h=1d21114a5bd9c3ea7b7f0132aac47acbf8230fa5;hb=97c80c7615102e500c162597807f7eaa3905891d;hp=70c1409ce638e518641ecde9953d6fd0dc22a9dd;hpb=8ba4f2e3adb9a1fda64b463b34a4306c9034359a;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/Connection.pm b/lib/Object/Remote/Connection.pm index 70c1409..1d21114 100644 --- a/lib/Object/Remote/Connection.pm +++ b/lib/Object/Remote/Connection.pm @@ -10,7 +10,7 @@ use Scalar::Util qw(weaken blessed refaddr); use JSON::PP qw(encode_json); use Moo; -our $DEBUG; +our $DEBUG = !!$ENV{OBJECT_REMOTE_DEBUG}; has send_to_fh => ( is => 'ro', required => 1, @@ -75,6 +75,7 @@ sub _build__json { BEGIN { unshift our @Guess, sub { blessed($_[0]) ? $_[0] : undef }; eval { require Object::Remote::Connector::Local }; + eval { require Object::Remote::Connector::LocalSudo }; eval { require Object::Remote::Connector::SSH }; } @@ -137,7 +138,7 @@ sub _serialize { my $flat = $self->_encode($self->_deobjectify($data)); warn "$$ >>> ${flat}\n" if $DEBUG; $flat; - } or do { + } || do { my $err = $@; # won't get here if the eval doesn't die # don't keep refs to new things delete @{$self->local_objects_by_id}{@New_Ids};