use Win32::NetAdmin qw[LoggedOnUser];
my @users;
LoggedOnUsers( '', \@users );
print $_, $/ for @users;
In general, if you working with Win32, then spending an hour or two looking through the Win32::* html pages/ pod is time well spent.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller