in reply to Why no stay shared warning?
This is needed because you need the block executed once in order for the variable to go into and then out of scope, forming a closure with your two named subroutines.up(); up(); print get(); BEGIN { my $foo = 1; sub up { $foo++; sub get {$foo} } }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Why no stay shared warning?
by danger (Priest) on May 05, 2001 at 21:48 UTC |