[Melbourne-pm] Module::Signatures and typos in packages

Toby Corkindale toby.corkindale at strategicdata.com.au
Thu Aug 11 02:06:28 PDT 2011

Jacinta mentioned Method::Signatures a little last night in her 

I hit an interesting problem with the module today.

If your file has some errors in it, then instead of getting an error 
like "Global symbol "$args" requires explicit package name at [..]", you 
get an error like this:
Can't call method "first_token" on an undefined value at 
[..]/Method/Signatures/Parser.pm line 17.

I was using a script and package that boiled down to the following..
However now I can't replicate the problem in the cut-down example :/

I thought I'd mention it just in case anyone else hits a similar issue 

--------- test.pl ---------
#!/usr/bin/env perl
use Thing;

----- Thing.pm -----------
package Thing;
use 5.14.1;
use warnings;
use Method::Signatures;

# Spot the error:
method go (%args) { $args->{go} }


More information about the Melbourne-pm mailing list