summaryrefslogtreecommitdiff
path: root/pod/perlsub.pod
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-09-20 22:29:03 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-09-20 22:29:03 -0700
commitae7a3cfaa7c05d7537a57944fcd3d1eec4080d3e (patch)
tree2d369242493c1d25a4c257c4370c9a2f465579fc /pod/perlsub.pod
parenta636ff160adfade25b615b2e632590a3763b285c (diff)
downloadperl-ae7a3cfaa7c05d7537a57944fcd3d1eec4080d3e.tar.gz
[perl #47365] Docs for \$ prototypes
\$ allows any hash/array element, even if it does not start with a dollar sign.
Diffstat (limited to 'pod/perlsub.pod')
-rw-r--r--pod/perlsub.pod9
1 files changed, 6 insertions, 3 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod
index 93f6e5f5af..9121519748 100644
--- a/pod/perlsub.pod
+++ b/pod/perlsub.pod
@@ -1093,9 +1093,12 @@ corresponding built-in.
sub mytime () mytime
Any backslashed prototype character represents an actual argument
-that absolutely must start with that character. The value passed
-as part of C<@_> will be a reference to the actual argument given
-in the subroutine call, obtained by applying C<\> to that argument.
+that must start with that character (optionally preceded by C<my>,
+C<our> or C<local>), with the exception of C<$>, which will accept a
+hash or array element even without a dollar sign, such as
+C<my_function()->[0]>. The value passed as part of C<@_> will be a
+reference to the actual argument given in the subroutine call,
+obtained by applying C<\> to that argument.
You can also backslash several argument types simultaneously by using
the C<\[]> notation: