Does the 'o' modifier for Perl regular expressions still provide any benefit?

后端 未结 6 1850
醉话见心
醉话见心 2020-11-29 07:48

It used to be considered beneficial to include the \'o\' modifier at the end of Perl regular expressions. The current Perl documentation does not even seem to list it, cert

6条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 08:31

    This is an optimization in the case that the regex includes a variable reference. It indicates that the regex does not change even though it has a variable within it. This allows for optimizations that would not be possible otherwise.

提交回复
热议问题