in reply to usage of o modifer
for my $word (qw( abc def )) { print $word =~ /\Q$word/ ?1:0,"\n"; # 1 1 } for my $word (qw( abc def )) { print $word =~ /\Q$word/o ?1:0,"\n"; # 1 0 }
It's was used to prevent a regex pattern from being compiled repeatedly, but Perl does that even without "o" now. And between the check to skip unecessary compiles and qr//, the "o" modifier is no longer needed.
|
|---|