Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: why package definition order affect the available of package variable

by rjt (Curate)
on Oct 20, 2019 at 11:56 UTC ( [id://11107720]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    say_foo();
    my $foo = 'foo';
    say_foo();
    ...
    __END__
    $foo = (undef)
    $foo = foo
    
  2. or download this
    say_foo();
    my $foo;
    BEGIN { $foo = 'foo' }
    ...
    __END__
    $foo = foo
    $foo = foo
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11107720]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 04:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found