In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Michael Hooten) writes:
>Simpler and easier to read:
>@combined = map { ref $_ eq 'ARRAY' ? @$_ : $_ } values %{$hash{family}};
>
>Either dereference the array or return the scalar.
Yes, I'm aware of the 'either' in the posting. However, the exa
D]
Subject: Re: using 'map' with mixture of scalars and array refs...
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Michael Kavanagh) writes:
>Hi there,
>
>I've got a hash that has keys which contain either
>- array references
>- scalar values
>
&
Michael Kavanagh wrote:
>
> Hi there,
Hello,
> I've got a hash that has keys which contain either
> - array references
> - scalar values
>
> for example:
> @values = (12398712984, 19286192879);
> $hashofarrays{'family'}{'arrayref'} = \@values;
> $hashofarrays{'family'}{'scalar'} = 12938712938;
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Michael Kavanagh) writes:
>Hi there,
>
>I've got a hash that has keys which contain either
>- array references
>- scalar values
>
>for example:
>@values = (12398712984, 19286192879);
>$hashofarrays{'family'}{'arrayref'} = \@values;
>$hashofarrays
Hi there,
I've got a hash that has keys which contain either
- array references
- scalar values
for example:
@values = (12398712984, 19286192879);
$hashofarrays{'family'}{'arrayref'} = \@values;
$hashofarrays{'family'}{'scalar'} = 12938712938;
I'm trying to map the hash into another array that