Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Then teardown() within MyAuth.pm would look like the following:#!/usr/local/bin/perl use MyAuth; ## has strict, warnings, etc. my $webapp = MyAuth->new( PARAMS => { 'Next_CGI' => "some_url_without_query_string" } ); $webapp->run();
Is this a reasonable way to handle an application using multiple CAs? Will it cause memory problems (bloat)? Thanks.sub teardown() my $self = shift; my $output = ''; ## probably best to store the following in a file my %Allowed_Scripts = ( 'https://site/pathto/ca.script1.cgi' => 1, 'https://site/pathto/ca.script2.cgi' => 1, ); ## usual teardown stuff my $url = $self->param('Next_CGI'); if ( exists($Allowed_Scripts{$url}) ) { if (authorized) { my $query_string = "?whatever"; $self->header_type('redirect'); $self->header_props( -url => "$url$query_string" ); } else { ## use template for unauthorized user message } } else { ## use template for unauthorized script message } return $output; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Structuring multiple CGI::Application modules
by valdez (Monsignor) on Jun 25, 2004 at 21:49 UTC | |
|
Re: Structuring multiple CGI::Application modules
by MrCromeDome (Deacon) on Jun 25, 2004 at 20:55 UTC | |
|
Re: Structuring multiple CGI::Application modules
by Arunbear (Prior) on Jun 25, 2004 at 21:21 UTC | |
by valdez (Monsignor) on Jun 25, 2004 at 21:57 UTC | |
|
Re: Structuring multiple CGI::Application modules
by dragonchild (Archbishop) on Jun 28, 2004 at 12:18 UTC |