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; #### String found where operator expected at croaktest.pl line 8, near "croak "this is a test"" (Do you need to predeclare croak?) syntax error at croaktest.pl line 8, near "croak "this is a test"" croaktest.pl had compilation errors. #### 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;