Subject: Re: [PATCH 5.6.0 IPC/Open3.pm] Allow the use of numeric fd's
Message-ID: <
20000625234312.B74147@linguist.dartmouth.edu>
p4raw-id: //depot/cfgperl@6253
close $_[0] or croak "$Me: close($_[0]) failed: $!";
}
+sub fh_is_fd {
+ return $_[0] =~ /\A=?(\d+)\z/;
+}
+
sub xfileno {
my ($fh) = @_;
- return $1 if $fh =~ /^=?(\d+)$/; # deal with $fh just being an fd
+ return $1 if =~ /\A=?(\d+)\z/; # deal with $fh just being an fd
return fileno $fh;
}
-sub fh_is_fd {
- return $_[0] =~ /^=?\d+$/;
-}
-
my $do_spawn = $^O eq 'os2' || $^O eq 'MSWin32';
sub _open3 {