From: short <> Date: Sat, 30 Nov 2002 20:06:02 +0000 (+0000) Subject: Fixed declaration scoping X-Git-Tag: bp_liverpm~89 X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=commitdiff_plain;h=ef33d723e44b9bfd72fe278a1877f04e29ac5fe8 Fixed declaration scoping --- diff --git a/src/Perl-Style b/src/Perl-Style index 10fe111..b4aedcb 100644 --- a/src/Perl-Style +++ b/src/Perl-Style @@ -202,7 +202,7 @@ Curly-bracketing all subexpressions for dereferencign explicitely if not trivial print @$arrayref; Declaration scope of 'my' in the non-sub{} file: Whole file inside one package. -Declaration scope of 'my' in sub{}: Only this sub{}, not accessible by callees. +Declaration scope of 'my' in sub{} or block {}: Only in { }, not accessible by callees. Declaration scope of 'local': This sub{} and globally for all callees. * Perfect for some nesting counters: my $func_nest=0; @@ -213,4 +213,4 @@ Declaration scope of 'local': This sub{} and globally for all callees. } * Built-in variables cannot be 'my' scoped, use 'local' instead Declaration scope of 'our'(5.6.0+) or 'use vars...': Global across packages. -(These scoping rules are IMO simplified but works4me.) +(These scoping rules are simplified but works4me.)