in reply to How come @_ gets changed here?
Respected Monks,
Thank you for taking time to reply.
I used & at the beginning of a function because, as per Learning Perl book, I am to use an & before calling the function, else, I might accidentally end up calling a perl built-in. In fact there is a link given in the book https://www.learning-perl.com/2013/05/why-we-teach-the-subroutine-ampersand/ which if I understood right, is stating it's better to use & when one is not sure.
But from the posts here, I reckon it's not encouraged. So I'm not sure if I should or shouldn't use the &. I will later try to test on other version(s) of Perl and see how it goes.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How come @_ gets changed here?
by Anonymous Monk on Jun 10, 2017 at 23:30 UTC |