allow glob references to be transferred
[scpubgit/Object-Remote.git] / lib / Object / Remote / GlobContainer.pm
diff --git a/lib/Object/Remote/GlobContainer.pm b/lib/Object/Remote/GlobContainer.pm
new file mode 100644 (file)
index 0000000..0ff6e19
--- /dev/null
@@ -0,0 +1,14 @@
+package Object::Remote::GlobContainer;
+use Moo;
+use FileHandle;
+
+has _handle => (is => 'ro', required => 1, init_arg => 'handle');
+
+sub AUTOLOAD {
+  my ($self, @args) = @_;
+  (my $method) = our $AUTOLOAD =~ m{::([^:]+)$};
+  return if $method eq 'DESTROY';
+  return $self->_handle->$method(@args);
+}
+
+1;