in reply to Re^2: mod-perl2 re-using $ENV{REMOTE_ADDR}
in thread mod-perl2 re-using $ENV{REMOTE_ADDR}

I would write that:
@IPs=split /,/, $ENV{HTTP_X_FORWARDED_FOR} // $ENV{REMOTE_ADDR};
as it is both shorter and clearer in its intent, and doesn't pointlessly set @IPs only to immediately re-set it. For pre-5.10 you'd have to use a conditional operator, which is left as an exercise for the reader.

Replies are listed 'Best First'.
Re^4: mod-perl2 re-using $ENV{REMOTE_ADDR}
by Anonymous Monk on May 03, 2023 at 08:07 UTC
    Or a list slice