# FILE: main script use strict; use warnings; (my $module) = $ENV{PATH_INFO} =~ m!^/([^/]+)/; # mind this regex, I'm coming back at it in a few secs! require "$module.pl"; my $content = $module->run(); #... print $header, $content, $footer; # FILE: any random module, let's say myawesomemodule.pl package myawesomemodule; use strict; use warnings; sub run { ... # generate content return $content; } 1; # hey; it's a require after all.