summaryrefslogtreecommitdiff
path: root/pod/perlsub.pod
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>2000-12-22 12:17:38 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-22 15:29:40 +0000
commit551e1d922a333f90a45a26904eb4d9882f7bd5d4 (patch)
tree165f10dcbb565db453a9cfef7096b16826754211 /pod/perlsub.pod
parenta61357a9a84c55ce0c74b8d2bbfb23900cb5bd17 (diff)
downloadperl-551e1d922a333f90a45a26904eb4d9882f7bd5d4.tar.gz
; was Re: Perlbug 20000322.006 status +update
Message-Id: <200012221217.MAA21332@tempest.npl.co.uk> p4raw-id: //depot/perl@8228
Diffstat (limited to 'pod/perlsub.pod')
-rw-r--r--pod/perlsub.pod12
1 files changed, 9 insertions, 3 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod
index ae128ceb59..cef8050731 100644
--- a/pod/perlsub.pod
+++ b/pod/perlsub.pod
@@ -699,7 +699,9 @@ I<must> use C<local> instead of C<my>.
=over 4
-=item 1. You need to give a global variable a temporary value, especially $_.
+=item 1.
+
+You need to give a global variable a temporary value, especially $_.
The global variables, like C<@ARGV> or the punctuation variables, must be
C<local>ized with C<local()>. This block reads in F</etc/motd>, and splits
@@ -716,7 +718,9 @@ in C<@Fields>.
It particular, it's important to C<local>ize $_ in any routine that assigns
to it. Look out for implicit assignments in C<while> conditionals.
-=item 2. You need to create a local file or directory handle or a local function.
+=item 2.
+
+You need to create a local file or directory handle or a local function.
A function that needs a filehandle of its own must use
C<local()> on a complete typeglob. This can be used to create new symbol
@@ -746,7 +750,9 @@ a local alias.
See L<perlref/"Function Templates"> for more about manipulating
functions by name in this way.
-=item 3. You want to temporarily change just one element of an array or hash.
+=item 3.
+
+You want to temporarily change just one element of an array or hash.
You can C<local>ize just one element of an aggregate. Usually this
is done on dynamics: