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.
In reply to Re: usage of o modifer
by ikegami
in thread usage of o modifer
by abubacker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |