#!/usr/bin/perl use strict; use warnings; my $REDIR; sub print; sub tee; sub tee { $REDIR = shift; } sub print { CORE::print $REDIR @_; CORE::print @_; } tee(*STDERR); ::print 123;