in reply to Re: Use of uninitialised value... but it is defined ?!
in thread Use of uninitialised value... but it is defined ?!

clear and neat explication, as always AnomalousMonk

this kind of problems happened to me too some time (years?) ago until i realized the right order.

my $variable = 'value'; ----------- ---------- | 1 | 3 BEGIN{ say $variable} --------------------- | 2

As the OP reveals, the compiletime runtime order implication is not so easely intellegible from docs: maybe is worth to put a note in perlmod where BEGIN block is described (well i do not understand why it is here, anyway; a separtate tutorial about the phases of the Perl process would not be better?).

The OP can profits the read of some stuffs about the matter:

L*

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.

Replies are listed 'Best First'.
Re^3: Use of uninitialised value... but it is defined ?!
by AnomalousMonk (Archbishop) on Mar 02, 2016 at 17:27 UTC
    this kind of problems happened to me too ...

    You and me both, brother. And thank you for the compliment.


    Give a man a fish:  <%-{-{-{-<