Possible Duplicate:
What does the function declaration “sub function($$)” mean?
sub t(&@) {
print @_;
}
t {print 1};
I tried to change &@ to &$ and it will fail.
What’s the lingo for it so that I can search?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
&@is a subroutine prototype. This lets you create syntax similar to the builtingrepfunction (accepts a BLOCK and then a LIST). The LIST can even be the empty list:().&$when used will force the second argument (which is mandatory) to be evaluated in scalar context. Since there is no second argument int {print 1};it will fail to compile.Read more about subroutine prototypes at:
perldoc perlsub.