develooper Front page | perl.perl5.porters | Postings from July 2012

Re: [perl #113554] my() with empty list causes weird error

Thread Previous | Thread Next
From:
Eric Brine
Date:
July 9, 2012 09:25
Subject:
Re: [perl #113554] my() with empty list causes weird error
Message ID:
CALJW-qHMEbpyDs5rvUx3PkdMmchOa5Y=z0dNb9sEJ7mWN8U6HQ@mail.gmail.com
On Sun, Jul 8, 2012 at 10:13 AM, Darin McBride <dmcbride@cpan.org> wrote:

> And, Eric, not that I have much say in the matter, but I'd find a simple
> comment "# no arguments" or even an empty prototype, to be a clearer way to
> document a lack of arguments ;-)


Perhaps, but Perl isn't in the business of enforcing style.

People like consistency. Some could very like being able to do
my () = @_;
where they normally do
my ($var) = @_;

To back that up, there was a bug file to stop
my ($self) = @_[IDX_SELF];
from warning because they would like to do that where they would normally do
my ($self, $arg) = @_[IDX_SELF, IDX_ARG];

Thread Previous | Thread Next


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