summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Friedl <jfriedl@regex.info>2002-03-04 04:14:45 -0800
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-04 22:06:22 +0000
commit59a184684080081a858d3e893c3a6393b3d132fe (patch)
treef1fafd26dcf8b7fe3881b1cfd4c0c0b8296f22a1
parent3b7765f26aaacdde7f74985a05c3e1b7969f9f73 (diff)
downloadperl-59a184684080081a858d3e893c3a6393b3d132fe.tar.gz
small doc update to promote '-no_match_vars' of 'use English'
Message-Id: <200203042014.g24KEjP08407@ventrue.corp.yahoo.com> p4raw-id: //depot/perl@15021
-rw-r--r--pod/perlform.pod2
-rw-r--r--pod/perlipc.pod2
-rw-r--r--pod/perlsec.pod2
-rw-r--r--pod/perlvar.pod23
4 files changed, 18 insertions, 11 deletions
diff --git a/pod/perlform.pod b/pod/perlform.pod
index b2c87fa9b0..53e348f7b3 100644
--- a/pod/perlform.pod
+++ b/pod/perlform.pod
@@ -187,7 +187,7 @@ stage in the expression to single-step the debugger through):
If you use the English module, you can even read the variable names:
- use English;
+ use English '-no_match_vars';
$ofh = select(OUTF);
$FORMAT_NAME = "My_Other_Format";
$FORMAT_TOP_NAME = "My_Top_Format";
diff --git a/pod/perlipc.pod b/pod/perlipc.pod
index e591f54bf8..80364b9148 100644
--- a/pod/perlipc.pod
+++ b/pod/perlipc.pod
@@ -374,7 +374,7 @@ write to the filehandle you opened and your kid will find it in his
STDIN. If you open a pipe I<from> minus, you can read from the filehandle
you opened whatever your kid writes to his STDOUT.
- use English;
+ use English '-no_match_vars';
my $sleep_count = 0;
do {
diff --git a/pod/perlsec.pod b/pod/perlsec.pod
index c86ac7c828..53192cb3ca 100644
--- a/pod/perlsec.pod
+++ b/pod/perlsec.pod
@@ -242,7 +242,7 @@ not called with a string that the shell could expand. This is by far the
best way to call something that might be subjected to shell escapes: just
never call the shell at all.
- use English;
+ use English '-no_match_vars';
die "Can't fork: $!" unless defined($pid = open(KID, "-|"));
if ($pid) { # parent
while (<KID>) {
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 4bd3cf9b31..ac4ebf828a 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -13,14 +13,20 @@ you need only say
use English;
-at the top of your program. This will alias all the short names to the
-long names in the current package. Some even have medium names,
-generally borrowed from B<awk>.
+at the top of your program. This aliases all the short names to the long
+names in the current package. Some even have medium names, generally
+borrowed from B<awk>. In general, it's best to use the
-If you don't mind the performance hit, variables that depend on the
-currently selected filehandle may instead be set by calling an
-appropriate object method on the IO::Handle object. (Summary lines
-below for this contain the word HANDLE.) First you must say
+ use English '-no_match_vars';
+
+invocation if you don't need $PREMATCH, $MATCH, or $POSTMATCH, as it avoids
+a certain performance hit with the use of regular expressions. See
+L<English>.
+
+Variables that depend on the currently selected filehandle may be set by
+calling an appropriate object method on the IO::Handle object, although
+this is less efficient than using the regular built-in variables. (Summary
+lines below for this contain the word HANDLE.) First you must say
use IO::Handle;
@@ -33,10 +39,11 @@ or more safely,
HANDLE->method(EXPR)
Each method returns the old value of the IO::Handle attribute.
-The methods each take an optional EXPR, which if supplied specifies the
+The methods each take an optional EXPR, which, if supplied, specifies the
new value for the IO::Handle attribute in question. If not supplied,
most methods do nothing to the current value--except for
autoflush(), which will assume a 1 for you, just to be different.
+
Because loading in the IO::Handle class is an expensive operation, you should
learn how to use the regular built-in variables.