PROTO in sub NAME (PROTO) {

2004-09-21 Thread Jeremy Kister
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

Re: PROTO in sub NAME (PROTO) {

2004-09-21 Thread WilliamGunther
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

Re: PROTO in sub NAME (PROTO) {

2004-09-21 Thread Jeff 'japhy' Pinyan
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