in reply to Question in Win32::LoggedOnUsers

Just a quick comment on your while loop. It works, but if all you want to do is step through the elements of a hash, the foreach loop is better suited (and more efficient) for the task:

foreach my $user (keys %users) { print $user,'=', $users{$user},"\n"; }
Note you don't need the arrays @keys and @values anymore.

Replies are listed 'Best First'.
Re^2: Question in Win32::LoggedOnUsers
by biswanath_c (Beadle) on Jul 02, 2008 at 16:54 UTC

    Thanks a lot guys!

    The suggestions worked for me!