[am]king ~/a/tmp$ cat a.pl { package Filter::Transcript; use Filter::Util::Call; sub filter { my $s = filter_read; warn "TRANSCRIPT: $_"; $s; } sub import { filter_add(\&filter); } sub unimport { filter_del() } BEGIN { $INC{"Filter/Transcript.pm"}++; } } print "hello, world\n"; use Filter::Transcript; for (0, 1) { print "this part of the code is transscribed\n"; } no Filter::Transcript; print "good bye\n"; __END__ [am]king ~/a/tmp$ perl a.pl TRANSCRIPT: TRANSCRIPT: for (0, 1) { TRANSCRIPT: print "this part of the code is transscribed\n"; TRANSCRIPT: } TRANSCRIPT: TRANSCRIPT: no Filter::Transcript; hello, world this part of the code is transscribed this part of the code is transscribed good bye [am]king ~/a/tmp$ perl -v This is perl 5, version 12, subversion 1 (v5.12.1) built for x86_64-linux Copyright 1987-2010, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. [am]king ~/a/tmp$