diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-03-18 01:28:00 +0000 |
---|---|---|
committer | Charles Bailey <bailey@genetics.upenn.edu> | 1996-03-18 01:28:00 +0000 |
commit | 6e47f80896b36bab7a1b96db9509e98a6f366c90 (patch) | |
tree | 3508edb22b51d50d90a7fc75bcd274abddd52f8d /pod/perlsub.pod | |
parent | e0ebc8091f2f566e6aabf3bb62d0df328e019634 (diff) | |
download | perl-6e47f80896b36bab7a1b96db9509e98a6f366c90.tar.gz |
Explain \ in prototypes, and fix var name in example
Diffstat (limited to 'pod/perlsub.pod')
-rw-r--r-- | pod/perlsub.pod | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod index 80d02d1ca5..b308298858 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -608,7 +608,10 @@ that parse almost exactly like the corresponding builtins. sub mytime () mytime Any backslashed prototype character represents an actual argument -that absolutely must start with that character. +that absolutely must start with that character. The value passed +to the subroutine (as part of C<@_>) will be a reference to the +actual argument given in the subroutine call, obtained by applying +C<\> to that argument. Unbackslashed prototype characters have special meanings. Any unbackslashed @ or % eats all the rest of the arguments, and forces @@ -662,7 +665,7 @@ And here's a reimplementation of grep: my $code = shift; my @result; foreach $_ (@_) { - push(@result, $_) if &$ref; + push(@result, $_) if &$code; } @result; } |