BEGIN { # get list of modules my @mods = glob("/home/cuberat/mods/*"); for( @mods ) { s/\.pm$//i; #strip .pm from end of file eval "use $_"; #use the module!\ } }