All the PERL books that I own, dont touch on use warnings except to say that you should use it.
But the problem is, it doesn't tell me all I need to know HOW to use it.

Here is the problem. I have writen a script to find the last logon date for users on the domain. It works fine, but when I turn warnings on, It warns me about the second line in this section of code.
Win32API::Net::UserGetInfo('\\\\'.$SERVER, $USER, 3, \%USER_INFO); if ( %USERLIST->{$USER}->{'TIME'} < %USER_INFO->{'LastLogon'}) { %USERLIST->{$USER}->{'TIME'} = %USER_INFO->{'lastLogon'}; %USERLIST->{$USER}->{'DISABLED'} = "DISABLED" if (%USER_INFO->{' +flags'} & UF_ACCOUNTDISABLE) } }
it saysUse of uninitialized value in numeric lt (<) at D:\BIN\SCRIPTS\PerlScripts\45daysold\45daysold.pl line 44 I already have a "my %USERLIST;" in the code, so how do I declare the anonymous hashes?

BatGnat

In reply to Warnings, and declaring Hashes of Hashes. by BatGnat

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.