X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlsub.pod;h=b440cd1d93021ceb68a16e774a353e0073d0cd14;hb=78f9721bf0dc33981bedf125bcfa5c0c42b69eba;hp=997631674f289203e419ba8943390cf059623481;hpb=74f5c340ebe31070e7a56e95f9fda2042294a033;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlsub.pod b/pod/perlsub.pod index 9976316..b440cd1 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -169,8 +169,8 @@ Do not, however, be tempted to do this: Like the flattened incoming parameter list, the return list is also flattened on return. So all you have managed to do here is stored -everything in C<@a> and made C<@b> an empty list. See L for alternatives. +everything in C<@a> and made C<@b> an empty list. See +L for alternatives. A subroutine may be called using an explicit C<&> prefix. The C<&> is optional in modern Perl, as are parentheses if the @@ -645,10 +645,6 @@ and in: all the subroutines are called in a list context. -The current implementation does not allow arrays and hashes to be -returned from lvalue subroutines directly. You may return a -reference instead. This restriction may be lifted in future. - =head2 Passing Symbol Table Entries (typeglobs) B: The mechanism described in this section was originally @@ -697,9 +693,11 @@ Despite the existence of C, there are still three places where the C operator still shines. In fact, in these three places, you I use C instead of C. -=over +=over 4 + +=item 1. -=item 1. You need to give a global variable a temporary value, especially $_. +You need to give a global variable a temporary value, especially $_. The global variables, like C<@ARGV> or the punctuation variables, must be Cized with C. This block reads in F, and splits @@ -716,7 +714,9 @@ in C<@Fields>. It particular, it's important to Cize $_ in any routine that assigns to it. Look out for implicit assignments in C 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 on a complete typeglob. This can be used to create new symbol @@ -746,7 +746,9 @@ a local alias. See L 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 Cize just one element of an aggregate. Usually this is done on dynamics: