As documented
use Modulename;
basically coincides with
BEGIN { require Modulename; import Modulename; }
while
use Modulename ();
basically coincides with
BEGIN { require Modulename; }
This means that parens indicate that you do not want to import anything. (It would also prevent the pragma from doing his job.)
Carp exports confess , croak and carp by default, so
use Carp;
not suitable for
use Carp qw( confess croak carp );
Using
use Carp ();
confess , croak and carp will not be added to the caller namespace. They will still be available through their full name.
use Carp (); Carp::croak(...);
source share