Perl Can't use string as a symbol ref while strict refs

后端 未结 3 656
执念已碎
执念已碎 2021-02-19 00:50

I need some guidance with the following Perl code. When I leave the no strict \'refs\', the sub works fine. But if the no strict \'refs\'

3条回答
  •  广开言路
    2021-02-19 01:09

    You're trying to use a string literal as a filehandle: in your foreach loop, $_ takes on the values "A","B",etc. So, don't do that. Just make a new filehandle and push that onto @FH.

提交回复
热议问题