Yes, %ENV{} is fairly magical (but good majic), and depends what's done outside the program, usually by the shell, but you mentioned
Using $ENV{'AUTH_USER'}, and (HTTP_PROXY_USER) and (REMOTE_USER) to check what is being pickde up as a user logs in
So in this case it looks like your script is being run by a web server, probably Apache, because these are variables defined by Apache.

That's where the catch is. They are defined in Apache documentation, but because of vulnerabilities when programmers rely on them for security, they are usually not set, or not set by default. So you're probably doing a fine job of looking for them, they are just not there, or aren't there in the more recent versions. Try looking for other Apache CGI defined variables, one's that don't depend on who the user is, and that will tell you if your use of %ENV{} is working OK. If it is, then you know that it's just that those particular variables related to the user just aren't there, and it's not your fault.

There's more info on this, if you want, in the Apache updated.

By the way: The best I've been able to do when the user variables were not available was to identify the IP address that the connection was coming from, but I had fixed IP addresses to work with, and you may not be this lucky.


In reply to Re: The %ENV{} hash... by rodion
in thread The %ENV{} hash... by s_m_b

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.