Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Debugging globjects/globs

by Anonymous Monk
on Aug 23, 2017 at 06:46 UTC ( [id://1197851]=note: print w/replies, xml ) Need Help??


in reply to Debugging objects

The best way doesnt involve debugger, the best is RTFineM or utsl, whichever works best for you , as relying on dumpers is guessing. You're not limited to using x you can use data:dump:streamer and whatever else dumps globjects

Replies are listed 'Best First'.
Re^2: Debugging globjects/globs
by Anonymous Monk on Aug 23, 2017 at 08:56 UTC

    Example

    $ perl -de 1 Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'perldoc perldebug' for more help. main::(-e:1): 1 DB<1> x use IO::All; use Data::Dump::Streamer; sub dd { Dump(@_); () +; } 0 0 DB<2> x our $banana = io('2.txt'); 0 IO::All::File=GLOB(0x16af5fc) -> DB<3> x dd $banana my ($class,$constructor,%flags,@flags); $class = 'IO::All'; $constructor = sub { package IO::All::Base; use warnings; use strict; my $self = $class->new(@_); foreach $_ (@flags) { $self->$_($flags{$_}); } $self->constructor($constructor); return $self; }; %flags = (); @flags = (); $IO_All_File1 = do{ require Symbol; Symbol::gensym }; *$IO_All_File1 = { _assert => 0, _autoclose => 1, _binary => undef, _binmode => undef, _encoding => undef, _lock => 0, constructor => $constructor, io_handle => undef, is_open => 0, mode => undef, name => '2.txt', package => 'IO::All', tied_file => undef }; bless( $IO_All_File1, 'IO::All::File' ); empty array DB<4> q $
      Wow. Such a lesson. Thanks.
      I haven't tried it out but why do you write x dd ... if your dd() just returns an empty list ?

      dd() seems to do all the writing already.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

        I rarely use the debugger, so thats how I remember to run some code, kinda like cpan client .. that dd works without x is news to me

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found