Q: Having a perl script make use of one among several secondary scripts I have a main program  mytool.pl to be run from the command line.  There are several auxillary scripts  special1.pl, special2.pl, etc.  which each contain a couple subroutines and a hash, all identically named across scripts.  Let's suppose these are named MySpecialFunction(), AnotherSpecialFunction() and %SpecialData.   
I'd like for mytool to include/use/import the contents of one of the special*.pl files, only one, according to a command line option. For example, the user will do:
bash> perl mytool.pl  --specialcase=5

and mytools will use MySpecialFunction() from special5.pl, and ignore all other special*.pl files.
Is this possible and how to do it? 
It's important to note that the selection of which special file to use is made at runtime, so adding a "use" at the top of mytool.pl probably isn't the right thing to do. 
Note I am a long-time C programmer, not a perl expert; I may be asking something obvious.
This is for a one-off project that will turn to dust in only a month.  Neither mytool.pl nor special?.pl (nor perl itself) will be of interest beyond the end of this short project.  Therefore, we don't care for solutions that are elaborate or require learning some deep magic.  Quick and dirty preferred.  I'm guessing that Perl's module mechanism is overkill for this, but have no idea what the alternatives are.

A: You can use a hash or array to map values of specialcase to .pl files and require or do them as needed.
#!/usr/bin/env perl

use strict; use warnings;

my @handlers = qw(one.pl two.pl);

my ($case) = @ARGV;
$case = 0 unless defined $case;

# check that $case is within range

do $handlers[$case];

print special_function(), "\n";


A: When you use a module, Perl just require's the module in a BEGIN block (and imports the modules exported items). Since you want to change what script you load at runtime, call require yourself.
if ($special_case_1) {
  require 'special1.pl';
  # and go about your business
}

Here's a good reference on when to use use vs. require.
