[Melbourne-pm] Module::Signatures and typos in packages
Toby Corkindale
toby.corkindale at strategicdata.com.au
Thu Aug 11 02:06:28 PDT 2011
Hi,
Jacinta mentioned Method::Signatures a little last night in her
presentation.
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
though.
--------- test.pl ---------
#!/usr/bin/env perl
use Thing;
Thing->go;
----- Thing.pm -----------
package Thing;
use 5.14.1;
use warnings;
use Method::Signatures;
# Spot the error:
method go (%args) { $args->{go} }
1;
More information about the Melbourne-pm
mailing list