http://www.perlmonks.org?node_id=1229194


in reply to Re: Assignment and use statement in the same BEGIN block
in thread Assignment and use statement in the same BEGIN block

Thanks choroba, my friend Discipulus, and tobyink for all the useful explanation.

Toby's clicks the most to me. And this snippet makes things very clear to me: BEGIN { say 1; BEGIN { say 2 } } printing 2 before 1. In other words, you ain't finish BEGIN'ing until you end (close) it. Sigh. And the specialness of the use statement again standing in my way.

Replies are listed 'Best First'.
Re^3: Assignment and use statement in the same BEGIN block -- oneliner
by Discipulus (Abbot) on Jan 31, 2019 at 20:31 UTC
    > you ain't finish BEGIN'ing until you end (close) it

    (this is life..)

    indeed! and I never realized they can be nested!

    perl -e "$}.=qq(BEGIN{print qq($_);)for(q(,rekcaH lreP rehtonA tsuJ)=~/./g);$}.=q(})x25;eval$}"

    L*

    update

    removed and published separately as obfu

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.