in reply to Returning array values

You do not have a problem returning an array. You can only return a list, or a reference to an array, commonly referred to as an arrayref.
my @Array = ( 1, 2, 3 ); my $ArrayRef = [ 1, 2, 3 ]; $ArrayRef = \@Array; ## How do you "de-reference" an array reference? @Array = @$ArrayRef; @Array = @{$ArrayRef};
Now I suggest you go and read perldata and perlref, until it all makes sense to you. These are perl basics, and you need to know them by heart.

update:

return @array; # DOES NOT RETURN AN ARRAY, IT RETURNS A LIST
Besides knowing the basics perl data structures and references (perl basics), the other important thing to know about is context. japhy wrote an excellent article on that: "List" is a Four-Letter Word.

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Returning array values
by cybear (Monk) on Jul 29, 2002 at 10:12 UTC
    I believe that if you remove the second @ and the ()
    from around the call to GetUsers():
     @users = @{GetUsers()};
    leaving you with  @users = GetUsers();
    your code should work the way you expected in the first place.