Je 2003-09-17 10:21:50 +0100, Robin Berjon skribis:sub foo { @_==2 ? shift->{foo} = shift : shift->{foo} }
sub foo { @_==2 ? $_[0]->{foo} = $_[1] : $_[0]->{foo} }
Probably marginally quicker, and doesn't leave that niggly feeling about
which shift might be evaluated in what order in a future version of
perl, etc, etc.
Cool, that's faster than the generated subs I'd come up with.
-Steve