use CGI; use strict; use Template; use Foo::Security; use Foo::Utilities qw/dienice/; my $q = CGI->new; my $template = Template->new( { INCLUDE_PATH => '../templates', RELATIVE => 1 } ); my $section = $q->param( 'section' ) || ''; my $sec = Foo::Security->new; my $template_data = { security => $sec->ctl_data }; my $sections = $sec->get_sections; if ( ! grep { /$section/ } @$sections ) { $sec->send_to_login; } else { $template->process( "${section}-frame.tmpl", $template_data ) or dienice $template->error(); }