Skip to content

Commit 922e8c4

Browse files
jidannijkeenan
authored andcommitted
Update perlop.pod
Elsewhere in the page we see > The bottom line is that using "/o" is almost never a good idea. So I'll get rid of /o here too. P.S., I also get rid of a newline, based on ``` $ echo 'while(<>){}if 0;'|perltidy while (<>) { } if 0; ```
1 parent f42f866 commit 922e8c4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pod/perlop.pod

+1-2
Original file line numberDiff line numberDiff line change
@@ -2106,9 +2106,8 @@ Examples:
21062106
# poor man's grep
21072107
$arg = shift;
21082108
while (<>) {
2109-
print if /$arg/o; # compile only once (no longer needed!)
2109+
print if /$arg/;
21102110
}
2111-
21122111
if (($F1, $F2, $Etc) = ($foo =~ /^(\S+)\s+(\S+)\s*(.*)/))
21132112

21142113
This last example splits C<$foo> into the first two words and the

0 commit comments

Comments
 (0)