in reply to Use of Carp outside of package won't compile...

Perl has two scoping mechanisms. Lexical scopes and packages. The key differences between the two are:

The use directive itself doesn't know or care about scope. It's all about the code in the import function of the loaded .pm.

use pragma; changes bits in a lexically-scoped compiler variable.
use Module qw( function ); creates a function in the current package.