Re: Dynamically creating a hash for keys()

[email protected] (Paul Makepeace)
Newsgroups perl.fwp
Message-ID <[email protected]>
Je 2004-10-20 10:04:25 +0100, Georg Moritz skribis:
> From the keyboard of Jason Foster [19.10.04,09:50]:
> > I tried making an anonymous hash as follows...
> >
> >      print( keys( %{ reverse( %hash ) } ) );
> 
> wrong brackets ;-)
> 
> print keys %{{reverse @{[%hash]}}}
> 
> coerce the hash into an anonymous array, deref it, reverse the
> resulting list, put it into an anonymous hash, get keys from the ref

This is unnecessary - reverse can operate directly on a hash (as I think
has been posted a coupla times elsewhere); perldoc -f reverse

P

-- 
Paul Makepeace .............................. http://paulm.com/inchoate/

"If you'd be rich, then that must make me a goddess."
   -- http://paulm.com/toys/surrealism/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.