use CGI::Carp qw[ confess ]; my $old_font = \&CGI::font; *CGI::font = sub { confess "font here!"; $old_font(@_) };