diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-04 13:36:58 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-09-04 13:36:58 +0000 |
commit | 5b794e0558240996f259d9acbc8089c989bf711e (patch) | |
tree | 693b09fef2c974731e0a7b016c7ca8fcec244fae /pod/perlsub.pod | |
parent | 3ed077a91c8fee94dd1130c8a8bc00b87ef80c1d (diff) | |
download | perl-5b794e0558240996f259d9acbc8089c989bf711e.tar.gz |
Add the \[$@%&*] prototype support.
p4raw-id: //depot/perl@11865
Diffstat (limited to 'pod/perlsub.pod')
-rw-r--r-- | pod/perlsub.pod | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pod/perlsub.pod b/pod/perlsub.pod index ea7546e95c..4329c161ff 100644 --- a/pod/perlsub.pod +++ b/pod/perlsub.pod @@ -926,6 +926,22 @@ 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. +You can also backslash several argument types simultaneously by using +the C<\[]> notation: + + sub myref (\[$@%&*]) + +will allow calling myref() as + + myref $var + myref @array + myref %hash + myref &sub + myref *glob + +and the first argument of myref() will be a reference to +a scalar, an array, a hash, a code, or a glob. + Unbackslashed prototype characters have special meanings. Any unbackslashed C<@> or C<%> eats all remaining arguments, and forces list context. An argument represented by C<$> forces scalar context. An |