use strict; use warnings; #use Carp qw(croak); package Test; use Carp qw(croak); sub croak_test { croak "this is a test"; } Test::croak_test;