#!/usr/bin/perl use strict; use warnings; BEGIN { *CORE::GLOBAL::open = sub (*;$@) { if(defined($_[0])) { use Symbol qw(); my $handle = Symbol::qualify($_[0], (caller)[0]); no strict 'refs'; if(@_ == 1) { return CORE::open($handle); } elsif(@_ == 2) { return CORE::open($handle, $_[1]); } else { return CORE::open($handle, $_[1], @_[2..$#_]); } } }; }