develooper Front page | perl.perl5.porters | Postings from October 1999

Re: mjd reminded me... (;$) prototype...

From:
Greg McCarroll
Date:
October 26, 1999 09:19
Subject:
Re: mjd reminded me... (;$) prototype...
Message ID:
3.0.1.32.19991026171717.015a55a0@pop3.demon.co.uk
At 12:14 26/10/99 -0400, Jeff Pinyan wrote:
>Why does
>
>  sub foo (;$);
>  print foo $a, $b;
>
>whine that foo has too many arguments?  This was one issue I meant to
>discuss, and then got totally involved in the reftype debate.
>
>Is this "expected" behavior?

this is what i would expect, ;$ implies that there are no mandatory
arguments, and potentially one optional argument. i.e. 0 or 1 arguments
are acceptable, but nothing else,

Greg

--
   "Every day when i wake up, I thank the Lord I'm Welsh."
   - International Velvet, Catatonia
****    Greg McCarroll (greg@mccarroll.demon.co.uk), London, England    ****



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About