#!perl -w use strict; # ALWAYS! a("what"); b("the"); { use vars ('$var'); local $var; # shared only between a() and somesub() sub a { local $var = shift; _somesub() } sub b { local $var = shift; _somesub() } # sub routines with a leading _ usually denotes a private func. sub _somesub { print $var, $/ } }
In reply to RE: RE: Re: access to my variables from other subs
by Adam
in thread access to my variables from other subs
by joe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |