X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlop.pod;h=a7553dff42e694bd308114e5e2ff4c993df7d1e8;hb=2decb4fb82e001e3c9671c57b61232c651a9c22c;hp=01074b3096ed69dda331f346d50c104ce7afb5d9;hpb=b350dd2f881c6f46f8125355cf7111e4c97d1870;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlop.pod b/pod/perlop.pod index 01074b3..a7553df 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -169,10 +169,10 @@ search or modify the string $_ by default. This operator makes that kind of operation work on some other string. The right argument is a search pattern, substitution, or transliteration. The left argument is what is supposed to be searched, substituted, or transliterated instead of the default -$_. The return value indicates the success of the operation. (If the +$_. The return value indicates the success of the operation. If the right argument is an expression rather than a search pattern, substitution, or transliteration, it is interpreted as a search pattern at run -time. This can be is less efficient than an explicit search, because the +time. This can be less efficient than an explicit search, because the pattern must be compiled every time the expression is evaluated. Binary "!~" is just like "=~" except the return value is negated in @@ -195,10 +195,11 @@ to the modulus operator as implemented by your C compiler. This operator is not as well defined for negative operands, but it will execute faster. -Binary "x" is the repetition operator. In scalar context, it -returns a string consisting of the left operand repeated the number of -times specified by the right operand. In list context, if the left -operand is a list in parentheses, it repeats the list. +Binary "x" is the repetition operator. In scalar context or if the left +operand is not enclosed in parentheses, it returns a string consisting +of the left operand repeated the number of times specified by the right +operand. In list context, if the left operand is enclosed in +parentheses, it repeats the list. print '-' x 80; # print row of dashes @@ -962,7 +963,7 @@ notably if the result of qr() is used standalone: my @compiled = map qr/$_/i, @$patterns; grep { my $success = 0; - foreach my $pat @compiled { + foreach my $pat (@compiled) { $success = 1, last if /$pat/; } $success; @@ -1073,9 +1074,9 @@ this expression: qw(foo bar baz) -is exactly equivalent to the list: +is semantically equivalent to the list: - ('foo', 'bar', 'baz') + 'foo', 'bar', 'baz' Some frequently seen examples: