in reply to Warnings, and declaring Hashes of Hashes.

I think you may be getting this warning because your hash keys are not consistent. if ( %USERLIST->{$USER}->{'TIME'} < %USER_INFO->{'LastLogon'}) vs. %USERLIST->{$USER}->{'TIME'} = %USER_INFO->{'lastLogon'}; One line uses LastLogon, both L's capitalized, while the other lastLogon, only the second L capitalized. The documentation for the Windows module you are using should state which is the correct spelling.

I notice that you are using an odd syntax for looking up hash keys. While %hash->{key} seems to work, the proper syntax is $hash{key}. The $ indicates that this is a scalar value, while the {key} indicates that it is an element of a hash.

Finally, regarding the question about warnings. my %USERLIST is unrelated to the issue of uninitialized value warnings, which apply only to scalar values. You may want something like this:

if (defined $USERLIST{$USER}{'TIME'} and defined $USER_INFO{'LastLogon'} and $USERLIST{$USER}{'TIME'} < $USER_INFO{'LastLogon'})

Replies are listed 'Best First'.
Re: Re: Warnings, and declaring Hashes of Hashes.
by BatGnat (Scribe) on Nov 30, 2000 at 03:15 UTC
    Thanks to all I solved the problem using this
    if (not defined $USERLIST{$USER}{'TIME'}) {$USERLIST{$USER}{'TIME'}=0} if ( $USERLIST{$USER}{'TIME'} < $USER_INFO{'lastLogon'}) { %USERLIST->{$USER}->{'TIME'} = $USER_INFO{'lastLogon'}; %USERLIST->{$USER}->{'DISABLED'} = "DISABLED" if ($USER_INFO{'flags +'} & UF_ACCOUNTDISABLE) }