use strict; use warnings; use FindBin q($Bin); use CGI; use lib "$Bin/path/to/webside/code"; use sys::Config; use sys::Core; my $cgi=CGI->new(); my $conf=sys::Config->new(); my $core=sys::Core->new($cgi,$conf); my $uri=$core->get_uri(); my @allowed=( [qr/sub1\.seite\.de/,'sites::Sub1'], [qr/sub2\.seite\.de/,'sites::Sub2'], [qr/www\.seite\.de/,'sites::Main'], [qr//,'sites::Error'], ); @allowed=@{$conf->get('websites')}; my $run; for(@allowed) { my ($r,$m)=@$_; if($uri=~$r and $m and eval("require $m") ) { $run=$m; last; } } die("NO WEBSITE") unless $run; my $site=$run->new($cgi,$conf); die($run->error()) unless $site; print $site->generate();