in reply to Overriding perl modules

perl already has the -M command-line option, just use that to load the module you want. See perlrun.

If that is too simplistic, then an easy way is to use the if pragma. You can test anything here provided it is available at compile time - which the command-line is. For example:
use strict; use warnings; use if (defined $ARGV[0] && $ARGV[0] eq "angshuman"), 'Gash'; use if (@ARGV == 0), 'File::Basename'; # Now use File::Basename or Gash subroutine calls my $file = basename($0); print "$file\n";