@users = @{GetUsers()}; map { $tk{user_list}->insert('end', -itemtype=>'imagetext', -text=>"$_", -image=>$im{ONE}) } @users; #### sub GetUsers { my $data; my $field; my @found; foreach my $item (@list) { while (my ($field, $data) = each %{$item}) { next if $field !~ /account/i; if (Win32::NetAdmin::UsersExist('',$data)) { print "This '$data' is a user account\n"; push (@found, $data); } } } #return @found; # this does not return correctly. #return [qw/One Two Three/]; #this will return correctly. }