use warnings; use strict; BEGIN { *CORE::GLOBAL::open = sub (*;$@) { print "in my open...\n"; # the following line calls the built-in open() function # directly with the params your sub received CORE::open($_[0], $_[1], $_[2]); } }; open my $fh, '<', 'blah' or die $!; print <$fh>; #### in my open... file contents