On Mar 13, 1:37 am, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Mar 12, 8:11 pm, Justus Schwabedal <[EMAIL PROTECTED]>
> wrote:
>
> > What do you need it for anyway? I just read about it and I think it's
> > useless
> > in python.
>
> Perl, like Python, has a separate compilation and run times.  One day,
> someone who was trying to use Perl for something asked, "You know,
> wouldn't it be neat-o if you could execute some Perl code *before* you
> compiled the script?"  And so (since that's usually enough reason to
> add something to Perl) was borne the BEGIN block.
>
> I believe the official rationale was that they wanted to add some
> magic variables that affected Perl's compilation and couldn't do it
> without a magic block that executed at compile time.
>
> Python solved a similar problem by introducing __future__ imports.
>
> Carl Banks

And theres me thinking it was part of Perls AWK compatibility code.

- Paddy.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to