Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLOB-based operations fail on objects drived from IO::Handle [rt.cpan.org #102383] #23

Open
toddr opened this issue May 11, 2017 · 0 comments

Comments

@toddr
Copy link
Member

toddr commented May 11, 2017

Migrated from rt.cpan.org#102383 (status was 'new')

Requestors:

From [email protected] on 2015-02-26 19:23:20:

Hi,

when the dependency to Scalar::Util was reduced by introducing

sub _is_glob{...}

some of my objects that were derived from IO::File stopped working (okay: 1.17).

This happens when the derived object is not detected as GLOB because the
class-/package-name does not start with "IO::". 

The bug becomes visible when i.e. LoadFile( $io_handle_based_obj ) is invoked.

'SomeClass::DerivedFromIO=GLOB(0x9b9670)' is empty or non-existent at .../YAML/Syck.pm line 129


The following patch, applied to 1.29 fixed the problem - at least for me:

-- Syck.pm.orig 2015-02-26 13:58:50.155024000 +0100
+++ Syck.pm 2015-02-26 13:57:00.326681000 +0100
@@ -88,6 +88,10 @@
 return 1 if ( ref( \$h ) eq 'GLOB' );
 return 1 if ( ref($h) =~ m/^IO::/ );
+#BEGIN-PATCH
+ return 1 if ( ref($h) and $h->isa('IO::Handle') );
+#END-PATCH
+
 return;
}


Thanks
Perlbotics
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant