$foo = "CGI"; require $foo; #this will bork $foo = "CGI.pm"; require $foo; #this won't #### BEGIN { sub which_finds_modules { #stuff goes here } @modules = which_finds_modules; foreach $mod(@modules) { require $mod; #make sure it has the extension! } }