From: Perl 5 Porters Date: Mon, 18 Mar 1996 01:28:00 +0000 (+0000) Subject: Explain \ in prototypes, and fix var name in example X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e47f80896b36bab7a1b96db9509e98a6f366c90;p=p5sagit%2Fp5-mst-13.2.git Explain \ in prototypes, and fix var name in example --- diff --git a/pod/perlsub.pod b/pod/perlsub.pod index 80d02d1..b308298 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; }