How can I process a multi line string one line at a time in perl with use strict in place?

前端 未结 7 1965
南旧
南旧 2021-02-15 13:32

I\'m trying to figure out the proper PBP approved way to process a multi line string one line at a time. Many Perl coders suggest treating the multi line string as a filehandle

7条回答
  •  醉话见心
    2021-02-15 13:59

    The more succinct PBP way is to use open like so:

    open my $ResultsHandle, '<', \$return;
    

    This eliminates the need for that earlier "my $Resultshandle;" declaration and avoids incurring that strict warning that you ran into.

提交回复
热议问题