http://www.perlmonks.org?node_id=152067


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.
{ my $new_mail; sub update_mail_list { # uses $new_mail } sub read_mail_list { # uses $new_mail } }
What do monks think about this style?

Thanks,
/prakash