in reply to scoping across parent/child relationship
You misunderstand scope and my and all that. Pray consider my explanation.
When you write:
$foo, %bar, and $bax are only visible within those braces.else { my ($foo, %bar, $bax); ... }
Initialize_child and do_child_stuff are presumable defined elsewhere (not within those braces). When they refer to $foo, etc., they are referring to global variables, hence the warning that you get (good on you for using 'use strict').
If you want those variables to be visible to those subs but nowhere else, do something like:
{ my ($foo, %bar, $bax); sub Initialize_child { # code here } sub do_child_stuff { # more code here } }
yours,
Michael
|
|---|