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:27
Subject:
Re: [perl #113554] my() with empty list causes weird error
Message ID:
CALJW-qHtbAgmt55wV0pU0zAk+21sNamr=rgKmT026y429SviVQ@mail.gmail.com
On Mon, Jul 9, 2012 at 12:25 PM, Eric Brine <ikegami@adaelis.com> wrote:

> 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];
>

Another example of such:

@a = (
   $foo,
   $bar,
);

instead of

@a = (
   $foo,
   $bar
);

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