powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
However, I was told that || was old and no longer acceptable and now I should use 'or' like this:$_cusIp = $ENV{'HTTP_X_FORWARDED_FOR'} || $ENV{REMOTE_ADDR};
so I changed to that, in a lot of places. however, the latter one is the one that works now, since we are not using forwarding anymore so it should be working but the ip addresses are all blank in the database when they were not when using the pipes. So was I wrong in changing to the use of the word or instead of the two pipes?$_cusIp = $ENV{'HTTP_X_FORWARDED_FOR'} or $ENV{REMOTE_ADDR};
Until I find out for sure.$_cusIp = $ENV{'HTTP_X_FORWARDED_FOR'}; $_cusIp = $ENV{REMOTE_ADDR} if !$_cusIp;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use of pipes and 'or'
by ikegami (Patriarch) on Jan 22, 2010 at 22:41 UTC | |
|
Re: use of pipes and 'or'
by kennethk (Abbot) on Jan 22, 2010 at 22:36 UTC | |
|
Re: use of pipes and 'or'
by InterGuru (Sexton) on Jan 24, 2010 at 14:16 UTC | |
by ikegami (Patriarch) on Jan 24, 2010 at 19:32 UTC |