My question is whether you should be concerned with scope if $new_mail needs to be shared between sub update_mail_list and sub read_mail_list etc.One trick I sometimes use to share a variable among multiple subroutines, without making it a package variable is to enclose all of them in a block.
What do monks think about this style?{ my $new_mail; sub update_mail_list { # uses $new_mail } sub read_mail_list { # uses $new_mail } }
Thanks,
/prakash
In reply to Re: Whether to use local()
by PrakashK
in thread Whether to use local()
by jerrygarciuh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |