edwardt_tril has asked for the wisdom of the Perl Monks concerning the following question:
so can I change WriteTOLog to:sub func1{ WriteTOLog($Arga,$Argb,$Argc,$Argd); } ... do a bunch of things <code> file b.pl <code> sub func2{ WriteTOLog($Arga,$Argb,$Argc,$Argd); } ... do a bunch of things <code> file c.pl <code> sub func3{ WriteTOLog($Arga,$Argb,$Argc,$Argd); } ... do a bunch of things <code> file log.pl <code> sub WriteToLog($,$,$,$){ local ($var) = @_; # do its fike IO stuff }
how to make those proginal files call MyWriteToLog when they see WriteTOLog? D I really have to change all these files?sub MyWriteToLog($,$,$,$){ if ($FLAG eq 1) { local ($var) = @_; # do its fike IO stuff WriteTOLog($a,$b,$c,$d); } else { #do nothing or other things; } }
2006-02-10 Retitled by broquaint, as per Monastery guidelines
Original title: 'intercept soub routine calls'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Intercept subroutine calls
by Fletch (Bishop) on Feb 10, 2006 at 00:33 UTC |