RE: Unknown level of hash

Jeff Yoak <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
I meant more that my answer was more "fun" than "useful."  I can't
imagine a reason one wouldn't prefer a loop to an eval.  :-)


On Mon, 2005-03-28 at 16:00, Zhuang Li wrote:
> Yes. I think it's both useful and fun. I was thinking something similar
> to
> @hash{@a} = map{1} @a; 

Well... that's not exactly it, but you can implicitly hijack the loop
behavior of things like map and grep, using them in void contexts.  I
think another poster showed a clever way to do that with a map.

The dim solution for perl6 was really interesting though.

Cheers,
Jeff
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.