“Variable $foo will not stay shared” Warning/Error in Perl While Calling Subroutine

后端 未结 4 1946
夕颜
夕颜 2020-12-16 12:03

Update3: If you like this posting please don\'t upvote me but upvote the genius answer by DVK below.

I have the following subroutines:<

4条回答
  •  自闭症患者
    2020-12-16 13:00

    Another (maybe simpler) way out is declare variables as "our" instead of "my"

    So,

    our %marked;
    

    instead of

    my %marked;
    

    etc.

提交回复
热议问题