in reply to wantarray and Tied Hashes

It doesn't seem so strange to me.

What is going on in a tie is this. When you go to use the tied structure, Perl figures out what requests it wants to do, and then calls your module for each request. So you pick up the context in which Perl calls FETCH, which apparently nobody thought to put in the context in which the hash lookup is found.

But now some people are wondering why there would be any distinction here, isn't the tie translation pretty direct? Well it isn't, and I can give a simple related example. Would most people consider it a bug if hash slices did not work with tied hashes? Yes. Would it be reasonable to have every person writing a tied hash have to reimplement the slice semantics? No. So Perl does that for you...

Anyways for what you want you will probably have to talk to p5p...

  • Comment on Re (tilly) 1: ttwantarray/tt and Tied Hashes