Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: Debugging objects

by zakame (Pilgrim)
on Aug 24, 2017 at 09:01 UTC ( #1197913=note: print w/replies, xml ) Need Help??


in reply to Re^2: Debugging objects
in thread Debugging objects

Thanks, that's right. Its because io() will emit an overloaded object so stringification would trigger.

You'll have to "peel off" the overloading, so to speak, by invoking overload::Overloaded (though funny, the perldoc says this should "true if 'arg' is subject to overloading...", wasn't expecting an actual GLOB object there.)

% perl -de 0 -MIO::All -MData::Printer Loading DB routines from perl5db.pl version 1.51 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): 0 DB<1> $io = io '.zshrc' DB<2> x overload::Overloaded( $io ) 0 GLOB(0x17a4378) -> *IO::All::(( DB<3> $o = overload::Overloaded( $io ) DB<4> Data::Printer::p($o) \ *IO::All::(( (layers: ) DB<5>

It would probably make a nice exercise to implement a Data::Printer filter for this.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1197913]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2019-05-20 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (125 votes). Check out past polls.

    Notices?