$ cat Foo.pm package Foo; use warnings; use strict; use Carp; sub one { die "Bad call to one"; } sub two { carp "Bad call to two"; } sub three { confess "Some error in three"; } 1; $ perl -I. -MFoo -le 'Foo::one' Bad call to one at Foo.pm line 5. $ perl -I. -MFoo -le 'Foo::two' Bad call to two at -e line 1. $ perl -I. -MFoo -le 'Foo::three' Some error in three at Foo.pm line 7. Foo::three() called at -e line 1