if (!$Session->{'isAuthenticated'})
{
$Response->write( 'session is authenticated' );
my $server_name = $Request->ServerVariables("SERVER_NAME")->item()
+;
$Response->write( "server name is '$server_name'" );
# ... etc ...
}
Get yourself a list of server names that you'll want to match and then take them into a separate small test program to make sure you can get what you want out of them.
my $server_name = 'www.example.com';
my ( $prefix, $domain )
= ( $server_name =~ m{ \A (\w+) \. (\w+) \. com }xms );
print "prefix: '$prefix'\n";
print "domain: '$domain'\n";
Also, my use of Test::More was just for demonstration. It's normally used for testing, not for anything else. |