Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
With the help of "smylers", I managed to create a poor man's version of strace for Perl. Basically, it's a touch of vim work with prints out almost every Perl line after that line is executed.
First, I add the following to the beginning of the program (though I put it all on one line):
use IO::Handle 'autoflush';
my $log = "db_upgrade.log";
open DEBUG_OUT, '>', $log or die $!;
autoflush DEBUG_OUT 1;
Then I type
noremap
,s :g/;$/
\ s/.*/&\t\t\tprint DEBUG_OUT 'Line ' . __LINE__ . q(: &).\"\\n\"; # XXX debug/
\ \| %s/^\(\s*);\)\s*print DEBUG_OUT.*/\1/
I then run !perl -c % a few times (mapped to
It's a nasty hack and I really need to look into other options.
Note that you need to do less cleanup if you use a unicode character for the q'' delimeter in the mapping, but my vim was choking on that. If I take the trouble to turn this into a proper function, that would make things easier to fix (I can escape things which give me grief). Also, if you have multi-line strings which end with a semicolon (such as SQL often does), then this will likely break.
What's up with Devel::Trace? (Score:2)
Re:What's up with Devel::Trace? (Score:2)
Devel::Trace is really close to what I want. However, it doesn't allow me to control the filehandle I want to send the trace output to, so error messages I might need are comingled with the trace output. However, the reality is, I didn't find that module when I was searching (I was searching for strace :), so this is only an "after the fact" gripe.
Re:What's up with Devel::Trace? (Score:1)
Re:What's up with Devel::Trace? (Score:2)
Well, I just sent an email to Dominus asking if he's interested in patches for it. Amongst other things, it would be nice to pass in callbacks so I can have fine-grained control over what's being dumped out, including access to the debugger API. It would be nice if I don't start tracing until $x >= 3 or simply don't trace except when a particular variable changes.
Re:What's up with Devel::Trace? (Score:2)
Oh, and thanks for pointing that module out.