#!/usr/bin/perl -w\n\nuse Win32::NetAdmin qw(LocalGroupGetMembers);\nuse Win32;\n\n\nmy $domain = "SERCO_GUIS";\nmy $pdc = "\\\\GUIS_FIL_SERVER";\nmy %groups;\n\nwhile (<>) {\n chomp;\n my $currentgroup = $_;\n print "$currentgroup\\n";\n my @currentgroupmembers;\n if (!LocalGroupGetMembers($pdc, $currentgroup, \\@currentgroupmembers)) {\n print "$^E\\n"; # print error code\n }\n $groups{$currentgroup} = @currentgroupmembers;\n}\n\nforeach $group(keys %groups) {\n print "$group: @ { $groups{$group} }\\n";\n}
It prints out the number of elements in each group, rather than the actual members.
I can see two possible points of failure here: either the "$groups{$currentgroup} = @currentgroupmembers;" assignment, or my expansion of the hash at the end.
Clues?