On Wed, 17 Sep 2003, Robin Berjon wrote:Shevek wrote:On Wed, 17 Sep 2003, Robin Berjon wrote:sub foo { @_==2 ? shift->{foo} = pop : shift->{foo} }
This is semantically different, and therefore not an appropriate answer.
Semantically different from what, and an appropriate answer to what? It DTRT.
As someone who uses closures a lot, and tends to have a lot of random things floating around in the tail end of @_, using the last element of @_ is very different to using the first element.
It's different from the buggy version that due to execution order inverted the first and second. However, since it tests that there are exactly two items in @_, if there are things floating around it'll revert to a get.
* darobin still doesn't see the problem, must be thick today
-- Robin Berjon <[EMAIL PROTECTED]> Research Scientist, Expway http://expway.com/ 7FC0 6F5F D864 EFB8 08CE 8E74 58E6 D5DB 4889 2488
