use strict; sub open { # log stuff here. CORE::open(@_); } if (-e $0 and open(my $fh, '<', $0)) { while(<$fh>) { print; } }