in reply to Are dynamic 'use' statements possible?

The following code may be found in Term::ReadLine:

my ($which) = exists $ENV{PERL_RL} ? split /\s+/, $ENV{PERL_RL} : unde +f; if ($which) { if ($which =~ /\bgnu\b/i){ eval "use Term::ReadLine::Gnu;"; } elsif ($which =~ /\bperl\b/i) { eval "use Term::ReadLine::Perl;"; } else { eval "use Term::ReadLine::$which;"; } } elsif (defined $which and $which ne '') { # Defined but false # Do nothing fancy } else { eval "use Term::ReadLine::Gnu; 1" or eval "use Term::ReadLine::Perl; + 1"; }

I think this is similar to what you are looking for.