Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Changing every subroutine in many perl scripts

by chromatic (Archbishop)
on Jul 26, 2012 at 05:55 UTC ( #983779=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Changing every subroutine in many perl scripts
in thread Changing every subroutine in many perl scripts

What are you trying to report? Are you trying to emit something for every executed function? In that case, close over the name of the wrapped function:

my @mars_subs = qw( add increment ); for my $sub (@mars_subs) { wrap $sub, pre => sub { print "Calling '$sub'\n"; }; }

Improve your skills with Modern Perl: the free book.


Comment on Re^3: Changing every subroutine in many perl scripts
Download Code
Re^4: Changing every subroutine in many perl scripts
by nitin1704 (Sexton) on Jul 26, 2012 at 09:06 UTC
    Thanks. Yes, I want to log how these various subroutines are called one after the other, for understanding how this set of perl scripts and modules works and the dependencies between them. It's all legacy code of thousands of lines. Is there a better way to do this?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2014-08-21 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls