summaryrefslogtreecommitdiff
path: root/pod/perlop.pod
diff options
context:
space:
mode:
Diffstat (limited to 'pod/perlop.pod')
-rw-r--r--pod/perlop.pod10
1 files changed, 6 insertions, 4 deletions
diff --git a/pod/perlop.pod b/pod/perlop.pod
index 313ed583a5..f70311b8e1 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -830,10 +830,12 @@ Examples:
($one,$five,$fifteen) = (`uptime` =~ /(\d+\.\d+)/g);
# scalar context
- $/ = ""; $* = 1; # $* deprecated in modern perls
- while (defined($paragraph = <>)) {
- while ($paragraph =~ /[a-z]['")]*[.!?]+['")]*\s/g) {
- $sentences++;
+ {
+ local $/ = "";
+ while (defined($paragraph = <>)) {
+ while ($paragraph =~ /[a-z]['")]*[.!?]+['")]*\s/g) {
+ $sentences++;
+ }
}
}
print "$sentences\n";