>===== Original Message From ts <decoux / moulon.inra.fr> =====
>>>>> "M" == Mathieu Bouchard <matju / sympatico.ca> writes:
>
>M> Perl's "tie" is by all standards a hack. However, from a user's point of
>M> view, it _works_, and as an idea it _works too_.
>
> What do you call _works_ ?

By works I would mean that people solve real problems with it,
and get answers they like.

By that measure, tie works and works very, very well.

> Just look at "Tying FileHandles". It's always easy to implement something
>which work partially and try to hide the problems (do you remember "my" ?)

I have looked at tying filehandles.  I have used it.  I have
solved real problems of my own with it.  I have shown others
how to use it to solve their problems as well.

Yes, it is fragile.  I know that.  Not only do I know that,
but the odds are very good that I am aware of more possible
areas of breakage in Perl's implementation and concept of it
than you are.  The first and most obvious one is that C
stuff that does not go through Perl's IO layers have no
way of knowing that a handle is tied.  Instead they get a
file descriptor and use that.  A classic example is that when
you tie STDOUT then call system, the output isn't trapped.

Oops.

(I should check whether this bug still exists, then send p5p
an email reminding them of it, and suggesting that they solve
it by loading IPC::Open3 and wrapping system properly...)

But even with the gotchas (and you correctly labelled IO as
one of the more problematic areas), this doesn't change the fact
that it is darned *USEFUL*.  People *LIKE* it.  People find it
a *FUN* way to do things.  And in the context of a language like
Ruby there is one very, very good reason to support it.  Which
is that it promotes creating *CONSISTENT* programming interfaces.
(FWIW the place where it is demanded least is for IO.)

Cheers,
Ben