diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-07-05 03:56:18 +0000 |
---|---|---|
committer | Charles Bailey <bailey@genetics.upenn.edu> | 1996-07-05 03:56:18 +0000 |
commit | 6d28dffb193f5fad8017f93037874bf95b65ec8f (patch) | |
tree | aa413c7f1060a04afbdc3fd0bea9584a7d8a0886 | |
parent | 425e5e39a5f055678a03c50bf38821650ba5714b (diff) | |
download | perl-6d28dffb193f5fad8017f93037874bf95b65ec8f.tar.gz |
perl 5.003_01: pod/perlsub.pod
Typos corrected
Update reference to AutoLoader/AutoSplit documentation
-rw-r--r-- | pod/perlsub.pod | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod index b308298858..4d186d2843 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -58,10 +58,10 @@ indistinguishable list. Perl does not have named formal parameters, but in practice all you do is assign to a my() list of these. Any variables you use in the function that aren't declared private are global variables. For the gory details -on creating private variables, see the sections below on L<"Private -Variables via my()"> and L</"Temporary Values via local()">. To create -protected environments for a set of functions in a separate package (and -probably a separate file), see L<perlmod/"Packages">. +on creating private variables, see the sections below on +L<"Private Variables via my()"> and L<"Temporary Values via local()">. +To create protected environments for a set of functions in a separate +package (and probably a separate file), see L<perlmod/"Packages">. Example: @@ -286,7 +286,7 @@ That will print out 20 and 10. You may declare "my" variables at the outer most scope of a file to totally hide any such identifiers from the outside world. This is similar -to a C's static variables at the file level. To do this with a subroutine +to C's static variables at the file level. To do this with a subroutine requires the use of a closure (anonymous function). If a block (such as an eval(), function, or C<package>) wants to create a private subroutine that cannot be called from outside that block, it can declare a lexical @@ -342,7 +342,7 @@ See L<perlrun> about the BEGIN function. =head2 Temporary Values via local() B<NOTE>: In general, you should be using "my" instead of "local", because -it's faster and safer. Execeptions to this include the global punctuation +it's faster and safer. Exceptions to this include the global punctuation variables, filehandles and formats, and direct manipulation of the Perl symbol table itself. Format variables often use "local" though, as do other variables whose current value must be visible to called @@ -637,7 +637,7 @@ without the prototype. The interesting thing about & is that you can generate new syntax with it: - sub try (&$) { + sub try (&@) { my($try,$catch) = @_; eval { &$try }; if ($@) { @@ -764,7 +764,7 @@ should just call system() with those arguments. All you'd do is this: system($program, @_); } date(); - who('am', i'); + who('am', 'i'); ls('-l'); In fact, if you preclare the functions you want to call that way, you don't @@ -779,9 +779,10 @@ A more complete example of this is the standard Shell module, which can treat undefined subroutine calls as calls to Unix programs. Mechanisms are available for modules writers to help split the modules -up into autoloadable files. See the standard AutoLoader module described -in L<Autoloader>, the standard SelfLoader modules in L<SelfLoader>, and -the document on adding C functions to perl code in L<perlxs>. +up into autoloadable files. See the standard AutoLoader module +described in L<AutoLoader> and in L<AutoSplit>, the standard +SelfLoader modules in L<SelfLoader>, and the document on adding C +functions to perl code in L<perlxs>. =head1 SEE ALSO |