in reply to Redefining print
Dominus to the rescue!
Devel::Trace to the rescue!
crazyinsomniac to the rescue!
The Devel::Trace link above will also yield Devel::TraceMethods, which was born here (a wheel of chromatic, which I reinvented last week), along with Devel::TraceLoad and Devel::TraceCalls. They're all worth a look, and the Trace(Calls|Methods) modules are very useful when working with parsers you're not familiar with (like Pod::Parser, which is how I stumbled upon all of these, after writing my own of course ;D -- the whole Devel:: tree is full of goodies)$> more file #!/usr/bin/perl -w use strict; _1: f(); _2: d(); _3: f(); sub f { print "F\n"; } sub d { print "D\n"; f(); } $>perl -d:Trace file >> file:4: _1: f(); >> file:8: sub f { print "F\n"; } F >> file:5: _2: d(); >> file:9: sub d { print "D\n"; f(); } D >> file:9: sub d { print "D\n"; f(); } >> file:8: sub f { print "F\n"; } F >> file:6: _3: f(); >> file:8: sub f { print "F\n"; } F
Happy Coding!!
update: This very good info to know, and will help you with debuggin your program, but an added feature, would be a duplication of the filehandles/sockets .... what I mean is, if your program opens a file/socket handle, and data goes over it, it'd be nice if -d:Trace would log that stuff as well ;)
| ______crazyinsomniac_____________________________ Of all the things I've lost, I miss my mind the most. perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;" |
|
|---|