sub my_print { if(UNIVERSAL::isa($_[0], 'GLOB' )) { my( $fh, $text)= @_; print $fh "my", $text; } else { print "my", $text; } }