How can I hook into Perl's print?

前端 未结 5 1209
情话喂你
情话喂你 2020-11-29 03:59

Here\'s a scenario. You have a large amount of legacy scripts, all using a common library. Said scripts use the \'print\' statement for diagnostic output. No changes are

5条回答
  •  孤街浪徒
    2020-11-29 04:27

    Lots of choices. Use select() to change the filehandle that print defaults to. Or tie STDOUT. Or reopen it. Or apply an IO layer to it.

提交回复
热议问题