[EMAIL PROTECTED] wrote:
> Just wondering if it is possible to store an array in a harsh ?

I think you mean "a hash".

> $this->{'friends'}=( "Jean" , "Eric" , "Yoon");
> 
> if it is possible, how can I later retrieve my "friends" array ?

You can't store an array in a hash element (hash values have to be scalars),
but you can store a *reference* to an array there. Example:

    $this->{'friends'} = [ "Jean", "Eric", "Yoon" ];

Note square brackets instead of parentheses.

You can retrieve the array by dereferencing the element:

    @friends = @{ $this->{'friends'} };
    print $friends[0]; # prints "Jean"

or

    $friends = $this->{'friends'};
    print $friends->[1]; # prints "Eric"

or even

    print $this->{'friends'}->[2]; # prints "Yoon"

Hope this helps.

Read up on `perldoc perldsc`, `perldoc perlref`, and `perldoc perllol` for
more inspiration

Cheers,
Philip

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to