grashoper has asked for the wisdom of the Perl Monks concerning the following question:

my previous post has more info puzzled by pages I have the following problem solved it was due to a transform, thanks to all for their assistance.

Replies are listed 'Best First'.
Re: question about code
by jethro (Monsignor) on Jun 13, 2008 at 02:20 UTC
    That long if statement is true when the server name (or whatever is in $Request->ServerVariables("SERVER_NAME")->item()) neither begins with 'www' or 'mlx' nor is 'localhost'

    If that is the case, it extracts the letters until the first '.' of the server name. For example if the server name is sef.mlxhelp.com, that would be 'sef'.>p> Then it constructs the html code   <inputH name="site" value="sef"/> out of it.

    If the long if statement is false, the rest of the code is executed. That code seems to construct a list of sites, where you can select one.

    Others with more experience with web coding will probably see much more.

    But I would suggest giving some more details. Why do you suspect $request->servervariables("SERVER_NAME") is undefinded? Which modules are used? Do you get any errors? What does the server log say?

Re: question about code
by apl (Monsignor) on Jun 13, 2008 at 09:53 UTC
    Slightly off-topic... Consider changing
    if (!(substr($Request->ServerVariables("SERVER_NAME")->item(),0,3) + eq "www") && !(substr($Request->ServerVariables("SERVER_NAME")->item +(),0,3) eq "mlx") && !(lc($Request->ServerVariables("SERVER_NAME")->i +tem()) eq "localhost"))
    to
    my $svr = $Request->ServerVariables("SERVER_NAME")->item(); if ((substr($svr,0,3) ne "www") && (substr($svr,0,3) ne "mlx") && (lc($svr) ne "localhost"))
    It's a little more readable.