in reply to my and local??
some repeat of previous posts, but:
my - creates a lexical variable. this variable is a temporary variable, only visible within the block in which it was declared. also provides deep-binding which is used to create closures.
local - creates a dynamic variable. this variable replaces the value of a package global variable until the end of the block. sub-blocks and subroutines called from this block retain this local value. does not provide deep-binding and so cannot be used to create closures.
my - creates a lexical variable. this variable is a temporary variable, only visible within the block in which it was declared. also provides deep-binding which is used to create closures.
local - creates a dynamic variable. this variable replaces the value of a package global variable until the end of the block. sub-blocks and subroutines called from this block retain this local value. does not provide deep-binding and so cannot be used to create closures.
|
---|
In Section
Seekers of Perl Wisdom