From: Simon Cozens [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 25, 2001 12:02 PM

> On Thu, May 24, 2001 at 11:28:27AM +0100, Cross David - dcross wrote:
> > my @array = $h{two};
>               ^
> In perl 5 at least, *this* is your scalar context.

Good point. But even if I change it to:

my @array = @h{two};

FETCH doesn't get called in list context (instead it gets called once in
scalar context for each key in the list - in this case once). I can see why
Perl does this and I _almost_ agree that it's the right thing.

Anyway, as I said before, you can work around it with

my @array = tied(%h)->FETCH('two');

If anyone is interested, Tie::Hash::Regex is currently winging its way to
your favourite CPAN mirror.

Dave...

-- 


The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged. If the reader 
of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  
If you have received this communication in error, please 
re-send this communication to the sender and delete the 
original message or any copy of it from your computer
system.

Reply via email to