blackadder has asked for the wisdom of the Perl Monks concerning the following question:
@users = @{GetUsers()}; map { $tk{user_list}->insert('end', -itemtype=>'imagetext', -text=>"$_", -image=>$im{ONE}) } @users;
Obviously I have a problem with returning an array, I need to return the @found array. I am not sure why the return qw/One Two Three/ works and the @found doesn’t.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. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning array values
by DamnDirtyApe (Curate) on Jul 29, 2002 at 08:37 UTC | |
|
Re: Returning array values
by PodMaster (Abbot) on Jul 29, 2002 at 08:41 UTC | |
by cybear (Monk) on Jul 29, 2002 at 10:12 UTC | |
|
Re: Returning array values
by valdez (Monsignor) on Jul 29, 2002 at 08:40 UTC | |
by blackadder (Hermit) on Jul 29, 2002 at 10:52 UTC | |
by valdez (Monsignor) on Jul 30, 2002 at 09:11 UTC |