| Devel-Dt documentation | Contained in the Devel-Dt distribution. |
Devel::Dt - Kind of emulates command line flag -Dt on normal perl
version 0.04
Use the module and it'll immediately begin acting like you'd started your perl with -Dt.
perl -MDevel::Dt -e 'print q(hi)'
The above program results in the following output. There is an outstanding bug that the arguments to the operations aren't being dumped.
(?:?) leavesub=0x84f6778 (?:?) const=0x84f6620 (?:?) negate=0x84f67f8 (?:?) enter=0x817cc78 (-e:1) nextstate=0x816d480 (-e:1) pushmark=0x8165818 (-e:1) const=0x816d618 (-e:1) print=0x816d568 (-e:1) leave=0x816d4b8
A Runops::Trace hook, installed as a mandatory hook.
Joshua ben Jore, <jjore at cpan.org>
Please report any bugs or feature requests to bug-devel-dt at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Devel-Dt. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
perldoc Devel::Dt
You can also look for information at:
Copyright 2008 Joshua ben Jore, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Josh Jore <jjore@cpan.org>
This software is copyright (c) 2011 by Josh Jore.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
| Devel-Dt documentation | Contained in the Devel-Dt distribution. |
package Devel::Dt; BEGIN { $Devel::Dt::VERSION = '0.04'; } # ABSTRACT: Kind of emulates command line flag -Dt on normal perl use warnings; use strict; use B (); use B::Utils (); use Runops::Trace (); # use Data::Dump::Streamer (); use IO::Handle; my $Dumper; my $CurrentFile; my $CurrentLine; my $OutputHandle; sub dt { my ( $op, $arity, @args ) = @_; my $name = $op->oldname; my $class = B::class( $op ); my $dumped = ''; if ( @args ) { $dumped = "@args"; # $dumped = $Dumper->Data( \ @args ); } if ( 'COP' eq $class ) { $CurrentFile = $op->file; $CurrentLine = $op->line; } $OutputHandle->printf( "(%s:%s) %s=0x%0x\n", $CurrentFile, $CurrentLine, $name, $$op, $dumped ) or warn "Can't write to $OutputHandle: $!"; return; } BEGIN { $CurrentFile = $CurrentLine = '?'; $OutputHandle = \ *STDERR; # $Dumper = Data::Dump::Streamer->new; # # $Dumper->Names( 'args' ); # $Dumper->Purity( 0 ); # $Dumper->Declare( 0 ); # $Dumper->KeyOrder( 'smart' ); Runops::Trace::enable_global_tracing( \&dt ); } () = -.0 __END__