David Cantrell wrote:
On Wed, Sep 17, 2003 at 11:21:50AM +0200, Robin Berjon wrote:
sub foo { @_==2 ? shift->{foo} = shift : shift->{foo} }

^^^^^ ^^^^^ Is the order of evaluation of those two shift()s guaranteed?

I thought about that as I was writing it, I normally use the $_[N] form. And in fact, it doesn't work since (now that coffee has settled in) it seems logical that the rhs gets evaluated before its assignment to the lhs, without which chained assignments wouldn't work.


Ah well.

sub foo { @_==2 ? shift->{foo} = pop : shift->{foo} }

:)

--
Robin Berjon <[EMAIL PROTECTED]>
Research Scientist, Expway      http://expway.com/
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488




Reply via email to