geektron has asked for the wisdom of the Perl Monks concerning the following question:
the variables declared in the child process are only used in sub Initialize and in sub do_child_stuff, so I would think that the scope is valid...if ( $pid = fork ) { ## parent process ## do parent stuff } else { ## child process my ( $foo, %bar, $bax ); Initialize_child(); do_child_stuff(); }
if I declare the variables earlier ( say, just before the fork ), there isn't a problem...
can anyone shed some light for me?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: scoping across parent/child relationship
by rchiav (Deacon) on Aug 30, 2001 at 21:17 UTC | |
|
Re: scoping across parent/child relationship
by Hofmator (Curate) on Aug 30, 2001 at 21:23 UTC | |
by geektron (Curate) on Aug 30, 2001 at 21:29 UTC | |
|
Re: scoping across parent/child relationship
by VSarkiss (Monsignor) on Aug 30, 2001 at 21:21 UTC | |
|
Re: scoping across parent/child relationship
by herveus (Prior) on Aug 30, 2001 at 21:23 UTC | |
|
Re: scoping across parent/child relationship
by demerphq (Chancellor) on Aug 30, 2001 at 22:49 UTC | |
by geektron (Curate) on Aug 30, 2001 at 23:57 UTC | |
by demerphq (Chancellor) on Aug 31, 2001 at 00:07 UTC | |
by rchiav (Deacon) on Aug 31, 2001 at 00:05 UTC |