From: Jeffrey Friedl Date: Mon, 4 Mar 2002 12:14:45 +0000 (-0800) Subject: small doc update to promote '-no_match_vars' of 'use English' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a1ce9542567c946a9e13885800d99a27d4b700db;p=p5sagit%2Fp5-mst-13.2.git small doc update to promote '-no_match_vars' of 'use English' Message-Id: <200203042014.g24KEjP08407@ventrue.corp.yahoo.com> p4raw-id: //depot/perl@15021 --- diff --git a/pod/perlform.pod b/pod/perlform.pod index b2c87fa..53e348f 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 e591f54..80364b9 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 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 c86ac7c..53192cb 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 () { diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 4bd3cf9..ac4ebf8 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. +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. 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. + +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.