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

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

Thread Previous | Thread Next
Eric Brine
July 9, 2012 09:25
Re: [perl #113554] my() with empty list causes weird error
Message ID:
On Sun, Jul 8, 2012 at 10:13 AM, Darin McBride <> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About