in reply to Whether to use local()
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 Section
Seekers of Perl Wisdom