sub func1{ WriteTOLog($Arga,$Argb,$Argc,$Argd); } ... do a bunch of things file b.pl sub func2{ WriteTOLog($Arga,$Argb,$Argc,$Argd); } ... do a bunch of things file c.pl sub func3{ WriteTOLog($Arga,$Argb,$Argc,$Argd); } ... do a bunch of things file log.pl sub WriteToLog($,$,$,$){ local ($var) = @_; # do its fike IO stuff } #### sub MyWriteToLog($,$,$,$){ if ($FLAG eq 1) { local ($var) = @_; # do its fike IO stuff WriteTOLog($a,$b,$c,$d); } else { #do nothing or other things; } }