From: Ronald J. Kimball Date: Sun, 25 Jun 2000 23:43:12 +0000 (-0400) Subject: Paranoia tweak on #6249. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a91d27a8913d432a227706c8bc80ed991d93c431;p=p5sagit%2Fp5-mst-13.2.git Paranoia tweak on #6249. 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 --- diff --git a/lib/IPC/Open3.pm b/lib/IPC/Open3.pm index facf39c..5078a9a 100644 --- a/lib/IPC/Open3.pm +++ b/lib/IPC/Open3.pm @@ -140,16 +140,16 @@ sub xclose { 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 {