use File::Basename qw/ basename /;
And here, we'll ask for no new functions at all:
use File::Basename qw/ /;
Why would you want to do that? Well, this directive tells Perl to
load up File::Basename, just as before, but not to
import any function names. Importing lets us
use the short, simple function names like basename
and dirname. But even if we don't import
those names, we can still use the functions. When they're not
imported, though, we have to call them by their full names:
use File::Basename qw/ /; # import no function names
my $betty = &dirname($wilma); # uses our own subroutine &dirname (not shown)
my $name = "/usr/local/bin/perl";
my $dirname = File::Basename::dirname $name; # dirname from the module
As you see, the full name of the dirname function
from the module is File::Basename::dirname. We can
always use the function's full name (once we've loaded
the module) whether we've imported the short name
dirname or not.
Most of the time, you'll want to use a module's default
import list. But you can always override that with a list of your
own, if you want to leave out some of the default items. Another
reason to supply your own list would be if you wanted to import some
function not on the default list, since most modules include some
(infrequently needed) functions that are not on the default import
list.