On Thu, Feb 15, 2001 at 10:04:51AM -0300, Branden wrote:
> Bart Lateur wrote:
> >
> > No, it's a misunderstanding between you and Tony. The "do" your
> > reference is talking about, is of the form
> >
> > do FILE
> >
> > where file is a string containing a filename, while Tony is talking
> > about the
> >
> > do BLOCK
> >
> > form. do FILE behaves just like eval() (except it reads its data from a
> > source file), while do BLOCK doesn't. Neither.
> >
>
> Why `do FILE' behaves like eval, if there's eval to do it? Isn't this a
> little too much not-orthogonal? Why don't we require `eval { do FILE }' to
> have the behaviour of not dying and setting $@ ?
And that would gains us what exactly?
As the Perl man page says, do FILE is like
scalar eval `cat FILE`;
If you take out the eval, you get:
scalar `cat FILE`;
which is pretty pointless.
I find a "let's require some extra hoops and red tape" not very-Perl like.
Perl is there for the programmer; not the other way around.
Abigail