in reply to Re^6: puzzled by pages
in thread puzzled by pages

At this point, I think perhaps it's time to insert some debugging statements and see what's really going on in there.

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.

Replies are listed 'Best First'.
Re^8: puzzled by pages
by grashoper (Monk) on Jun 11, 2008 at 23:47 UTC
    odd it works if I assign it directly like your example (at least it will print something ) but I am having a terrible time figuring out how to echo the contents so I can see what is getting caught here is another attempt as you can see I borrowed heavily from your example, if my url is www.tempohelp.com it prints exactly as it should the www and the example, but if I modify to be this it will print www.tempohelp.com but it won't print snd.tempohelp.com for example this site is using a heredoc for output, and the problem seems to be located elsewhere in the code, its really got me stumped.
    sub transform { if (!$Session->{'isAuthenticated'}) { my $host=$Request->ServerVariables("SERVER_NAME")->item(); $Response->write("This is $host"); }