how is the (PROTO) operator in 'sub NAME (PROTO) {' supposed to be useful ?
sub foo {
sub foo ($) {
sub foo ($$) {
sub foo ($$$) {
sub foo ($@) {
sub foo (@) {
i see the relation to the amount of arguments supposed to be in @_ ---
my handy perl QRG provides a worthless explenation.
there doesn
Prototyping can be useful in Perl. It shouldn't be overused, however. They
can be powerful when trying to make functions that look and feel like
built-ins. Trying to, for example, create a subroutine that looks like map, grep, and
sort is made by prototyping it as (&@) (will pass coderef and
On Sep 21, Jeremy Kister said:
>how is the (PROTO) operator in 'sub NAME (PROTO) {' supposed to be useful ?
Prototypes are only useful:
1. when the function is prototyped BEFORE it is called,
2. when the function is called without an &, and
3. when the function is not a method of an object.
See