Not only does the & form make the argument list optional, it also disables any prototype checking on arguments you do provide.
$ perl -le 'sub foo(\@) { ref(shift) ? "ref" : "not a ref" }; @arr=(1. +.3); print foo(@arr)' ref $ perl -le 'sub foo(\@) { ref(shift) ? "ref" : "not a ref" }; @arr=(1. +.3); print &foo(@arr)' not a ref
In reply to Re: Dereferencing arrays
by hazylife
in thread <SOLVED>Dereferencing arrays
by divitto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |