#!/usr/bin/perl -w use Carp; sub UNIVERSAL::AUTOLOAD { carp "foo"; } bar(); Error :- foo at l.pl line 5 UNIVERSAL::AUTOLOAD() called at l.pl line 8