Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

question about code

by grashoper (Monk)
on Jun 12, 2008 at 21:03 UTC ( [id://691799]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://691799]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-25 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found