On Mon, Jul 30, 2001 at 11:45:38PM +0200, Marc A. Lehmann wrote:
> > I'm trying to think of common places where C<sort @inplace> might
> > accidentally be used in list context, such as the end of a block,
>
> How about:
> [example that didn't work as advertized, later backed up by one that did]
I don't understand where you are on this. Are you saying that the backward
compatibility police might object? Why? Because someone might be using sort
(unknowingly) in a scalar/void context and relying on side-effects? I don't
think there's any backwards compatability problems at all here.
And as far as accidental use in a list/scalar context: wouldn't that be a
problem now anyways?
> > I'm also thinking if there's any functionality in Perl that is
> > analogous. ie. in one context it leaves its arguments alone, in
> > another it modifies them.
>
> It looks very dangerously to me ;)
This is the real issue (if there IS a real issue, and I don't believe there
is). But the problem solved is similar to that of keys/values and each; and
the "smart" range operators in later perls: avoiding having heaping piles of
crap returned by an operator/function that can better be done in place. If
we can do this without adding a keyword I don't see why not.
This feels like the Right Thing to do. It really does.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours *and*
[EMAIL PROTECTED] Perl Developer's Dictionary
"If you rush a Miracle Man, for details, see http://geeksalad.org
you get rotten Miracles." --Miracle Max, The Princess Bride