in reply to Re: wantarray and Tied Hashes
in thread wantarray and Tied Hashes
Thanks for the ideas. I tried adding the following lines to my test script:
$scalar = tied(%h)->FETCH('one'); @array = tied(%h)->FETCH('two');
And that returned
wantarray is false wantarray is true
so it seems to me that Perl is doing something to force scalar context somewhere in the tie interface.
To explain why I want FETCH to be callable in a list context, look at Tie::Hash::Regex. I'm thinking that if a hash is matching keys using regexes, then you could match more than one key and return a list of values in list context.
--
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: wantarray and Tied Hashes
by tye (Sage) on May 24, 2001 at 23:31 UTC | |
by Vynce (Friar) on May 26, 2001 at 03:04 UTC |