In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d962e43687db045a52ba2406aafccd53e6af23ff?hp=dadfa42fb02fe7b0f6ea851e790cb5fe6f87fd15>
- Log ----------------------------------------------------------------- commit d962e43687db045a52ba2406aafccd53e6af23ff Author: Shlomi Fish <shlo...@shlomifish.org> Date: Fri Oct 10 15:33:39 2014 +0300 remove trailing whitespace. For: RT #122942 (first patch) ----------------------------------------------------------------------- Summary of changes: pod/perlref.pod | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pod/perlref.pod b/pod/perlref.pod index 6c5a7e1..12e1e14 100644 --- a/pod/perlref.pod +++ b/pod/perlref.pod @@ -69,7 +69,7 @@ References can be created in several ways. X<\> X<backslash> By using the backslash operator on a variable, subroutine, or value. -(This works much like the & (address-of) operator in C.) +(This works much like the & (address-of) operator in C.) This typically creates I<another> reference to a variable, because there's already a reference to the variable in the symbol table. But the symbol table reference might go away, and you'll still have the @@ -655,13 +655,13 @@ that generated HTML font changes for the various colors: The red() and green() functions would be similar. To create these, we'll assign a closure to a typeglob of the name of the function we're -trying to build. +trying to build. @colors = qw(red blue green yellow orange purple violet); for my $name (@colors) { no strict 'refs'; # allow symbol table manipulation *$name = *{uc $name} = sub { "<FONT COLOR='$name'>@_</FONT>" }; - } + } Now all those different functions appear to exist independently. You can call red(), RED(), blue(), BLUE(), green(), etc. This technique saves on @@ -699,7 +699,7 @@ operator, as they are created on the fly. If you are accustomed to using nested subroutines in other programming languages with their own private variables, you'll have to work at it a bit in Perl. The intuitive coding of this type of thing incurs mysterious warnings about "will not stay -shared" due to the reasons explained above. +shared" due to the reasons explained above. For example, this won't work: sub outer { -- Perl5 Master Repository