Skip to content
Browse files

[rt.cpan.org 67680] Use IO::Handle::blocking() rather than $fh->block…

…ing().

Some file handles, such as my $fh = do { no warnings; local *FH };
can't be used as IO::Handle objects.  IO::Handle::blocking($fh) seems
to work, though.

This was caught by Troy, who was nice enough to open the bug.  Thanks!
  • Loading branch information...
1 parent a83e3fd commit 8a0894ef9c2be24d9681c166d2fbfb1970a02fbb @rcaputo committed
Showing with 4 additions and 2 deletions.
  1. +3 −1 lib/POE/Resource/FileHandles.pm
  2. +1 −1 mylib/PoeBuildInfo.pm
View
4 lib/POE/Resource/FileHandles.pm
@@ -451,7 +451,9 @@ sub _data_handle_condition {
# Compilation failed in require
# at t/20_resources/10_perl/filehandles.t line 9.
- $handle->blocking(0) if $] >= 5.008001 or not (tied *$handle or -f $handle);
+ IO::Handle::blocking($handle, 0) if (
+ $] >= 5.008001 or not (tied *$handle or -f $handle)
+ );
# Turn off buffering.
# you may be tempted to use $handle->autoflush(1) BUT DON'T DO THAT! ( things blow up )
View
2 mylib/PoeBuildInfo.pm
@@ -25,7 +25,7 @@ push @ISA, qw(Exporter);
sub CONFIG_REQUIREMENTS () {
(
- "POE::Test::Loops" => '1.350',
+ "POE::Test::Loops" => '1.351',
);
}

0 comments on commit 8a0894e

Please sign in to comment.
Something went wrong with that request. Please try again.