From: "John W. Krahn" <[EMAIL PROTECTED]>
> Edward WIJAYA wrote:
> > Hi,
> 
> Hello,
> 
> > Suppose I have this Hash of array:
> > 
> > %HoA = {
> 
> If you had warnings enabled then that would have produced a warning. 
> It should be either:
> 
> %HoA = ( ... );
> 
> Or:
> 
> $HoA = { ... };
> 
> 
> >    A => ["fred", "barney"],
> >    B => ["george", "jane", "elroy"],
> > };
> > 
> > Is there any efficient way to append
> > each of this HoA's array into one
> > single array, e.g:
> > 
> > @name = ("fred", "barney", "george", "jane", "elroy");
> 
> my @name = map @$_, @HoA{ keys %HoA };

Why not 

        my @name = map @$_, values %HoA;

? :-)

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to