using 'map' with mixture of scalars and array refs...

2002-10-22 Thread KAVANAGH, Michael
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

RE: using 'map' with mixture of scalars and array refs...

2002-10-23 Thread Peter Scott
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

Re: using 'map' with mixture of scalars and array refs...

2002-10-22 Thread Peter Scott
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

Re: using 'map' with mixture of scalars and array refs...

2002-10-22 Thread John W. Krahn
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;

RE: using 'map' with mixture of scalars and array refs...

2002-10-23 Thread Michael Hooten
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 > &