#!/usr/bin/perl -l # # main.pl # use strict; use warnings; sub foo { 'foo'; } sub bar { 'bar'; } print foo(); { no warnings 'redefine'; local *foo=\&bar; do "inc.pl"; } print foo();