BuildAll and DemolishAll are loaded on first ->new so need to be explicitly packed
[scpubgit/Object-Remote.git] / lib / Object / Remote / Connector / STDIO.pm
index 4ea49af..ee34319 100644 (file)
@@ -1,6 +1,7 @@
 package Object::Remote::Connector::STDIO;
 
 use File::Spec;
+use IO::Handle;
 use Object::Remote::Connection;
 use Moo;
 
@@ -12,10 +13,10 @@ sub connect {
   # only potentially bloody confusing but results in warnings like:
   # "Filehandle STDOUT reopened as STDIN only for input"
   close STDIN or die "Closing stdin: $!";
-  open STDIN, '<', File::Spec->dev_null or die "Re-opening stdin: $!";
+  open STDIN, '<', File::Spec->devnull or die "Re-opening stdin: $!";
   close STDOUT or die "Closing stdout: $!";
-  open STDOUT, '>', File::Spec->dev_null or die "Re-opening stdout: $!";
-  Object::Remote::Connection->new(
+  open STDOUT, '>', File::Spec->devnull or die "Re-opening stdout: $!";
+  return Object::Remote::Connection->new(
     send_to_fh => $stdout,
     receive_from_fh => $stdin
   );