C
Chris Newton
Hi all,
I think I've been looking at this too long, now, and I'm just missing
the blindingly obvious...
I want to pass back a sequence of values from a function, to put into a
hash mapping from strings onto string arrays. I tried this (obviously
simplified here) approach:
my %hash;
my $key = "key";
@hash{$key} = values();
sub values
{
return ("value1", "value2");
}
After this, @hash{"key"} seems to be an array containing just the one
string "value1". Why wouldn't this call be working in list context, and
stuffing both values into the hash entry?
Thanks in advance for any insights.
Chris
I think I've been looking at this too long, now, and I'm just missing
the blindingly obvious...
I want to pass back a sequence of values from a function, to put into a
hash mapping from strings onto string arrays. I tried this (obviously
simplified here) approach:
my %hash;
my $key = "key";
@hash{$key} = values();
sub values
{
return ("value1", "value2");
}
After this, @hash{"key"} seems to be an array containing just the one
string "value1". Why wouldn't this call be working in list context, and
stuffing both values into the hash entry?
Thanks in advance for any insights.
Chris