develooper Front page | perl.perl5.porters | Postings from January 2020

Re: Idea for new warning - scalar assignment from @_

Thread Previous | Thread Next
Dave Mitchell
January 14, 2020 10:41
Re: Idea for new warning - scalar assignment from @_
Message ID:
On Mon, Jan 13, 2020 at 10:16:30PM +0100, demerphq wrote:
> On Mon, 13 Jan 2020 at 19:38, Paul "LeoNerd" Evans

[ just repeating here what I added to the github thread]

While such a warning will of course flush out possible bugs, it will also
warn on existing perfectly valid code, such as

    my $nargs = @_;

A quick CPAN grep of \$\w+\s*=\s*\@_; matches 267 distributions, and
looking at the first few hits, about 2/3 appear to be valid uses.

Coupled with code that may have done "use warnings FATAL => 'all'", there
is lots of scope for breakage of existing code. So its a -1 from me.

The warp engines start playing up a bit, but seem to sort themselves out
after a while without any intervention from boy genius Wesley Crusher.
    -- Things That Never Happen in "Star Trek" #17

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About