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

后端 未结 3 674
执念已碎
执念已碎 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条回答
  •  旧时难觅i
    2021-02-19 01:14

    Don't assign $fh = $_ it's not doing anything useful.

    @FH should be %FH and instead of the push try:

    $FH{ $_ } = $fh
    

    Replace the $1 with $FH{ $1 }.

提交回复
热议问题