Well, yes. But you're using a lot of unnecessary syntax.
This:
$hash{$key}[0] = "Bastian";
$hash{$key}[1] = "Ang";
$hash{$key}[2] = "Next Door";
$hash{$key}[3] = "to Alice";
does the same thing.
HTH,
Rob
----- Original Message -----
From: "Angerstein" <[EMAIL PROTECTED]>
To: "Mailinglist Perl Beginners" <[EMAIL PROTECTED]>
Sent: Wednesday, November 27, 2002 1:21 PM
Subject: How to add a value to an array in a hash?
>
> Hello there,
>
> I have / or want to have an hash of arrays.
>
> @{ $hash{"$key"}}
>
> And I want to add an value to different fields of the array.
>
> Is this the way it works??????????
> @{ $hash{"$key"}}[0] = "Bastian";
> @{ $hash{"$key"}}[1] = "Ang";
> @{ $hash{"$key"}}[2] = "Next Door";
> @{ $hash{"$key"}}[3] = "to Alice";
>
> Or is that wrong?
>
> Thx
>
> Bastian
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]