NAME
Acme::Echo - Display perl statements before, after, and/or during execution
VERSION
Version 0.02
SYNOPSIS
use Acme::Echo qw/lines/;
print "hello world\n";
print "blah\n";
no Acme::Echo;
print "foo\n";
my $srclog;
BEGIN{ open $srclog, '>', "srclog.txt" or die; }
use Acme::Echo 'after', src_fmt=>"This code was just executed==>\n%s\n<==\n", fh=>$srclog;
...
IMPORT PARAMETERS
One or more of before/after/lines may be specified. At least one shoud be specified (pointless otherwise). The others are optional.
- before
-
Print out the entire code source before execution.
- after
-
Print out the entire code source after execution.
- lines
-
Print out each line of source right before its execution (note Limitations below).
- line_fmt
-
The sprintf format used for printing lines in lines mode. Defaults to "%s\n".
- src_fmt
-
The sprintf format used for printing the whole source in before/after modes. Defaults to "==>\n%s\n<==\n".
- fh
-
A filehandle to print to. Defaults to *STDOUT.
BUGS & LIMITATIONS
The lines mode doesn't currently support compound or sub statements.
TODO
line numbering for the blocks for before and after modes
More thorough test suite, including code that uses loops, subs, if/else ladders, closures, etc.
make the PPI loading dynamic; and make PPI an optional prereq (And SKIP in tests); So that can use before and after modes w/o having PPI installed.
AUTHOR
David Westbrook (davidrw), <dwestbrook at gmail.com>
BUGS
Please report any bugs or feature requests to bug-acme-echo at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-Echo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
I'm also available by email or via '/msg davidrw' on http://perlmonks.org.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Acme::Echo
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
Samy_rio for his post (http://perlmonks.org/?node_id=568087) that inspired this.
COPYRIGHT & LICENSE
Copyright 2006 David Westbrook, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.