Skip Menu |

This queue is for tickets about the Method-Signatures-Simple CPAN distribution.

Report information
The Basics
Id: 80511
Status: resolved
Priority: 0/
Queue: Method-Signatures-Simple

People
Owner: Nobody in particular
Requestors: MAUKE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.02
Fixed in: (no value)



Subject: a warning for nonsensical signatures would be nice
$ cat bug/slurpy #!perl use Method::Signatures::Simple; func foo(@x, $y) {} __END__ $ perl bug/slurpy $ It would be nice if Method::Signatures::Simple warned (or errored) about putting any parameter after an array/hash in a signature.
On Tue Oct 30 19:14:55 2012, MAUKE wrote: Show quoted text
> $ cat bug/slurpy > #!perl > use Method::Signatures::Simple; > func foo(@x, $y) {} > __END__ > $ perl bug/slurpy > $ > > It would be nice if Method::Signatures::Simple warned (or errored)
about Show quoted text
> putting any parameter after an array/hash in a signature.
That might be nice. But perl doesn't warn about it either: perl -e ' use strict; use warnings; sub foo { my (@x, $y) = @_; return $y } print foo(1, "foo"); ' Use of uninitialized value in print at -e line 5. That doesn't mean we couldn't do better, but it does mean I have an excuse for being lazy ;-) I actually have some code that looks at the sigils in CGI::Application::Plugin::RunmodeDeclare, so it wouldn't be too hard to put this together. Have a look at both if you feel like implementing this, and see the Github repos to add a pull request. rhesa