Skip Menu |

This queue is for tickets about the Devel-Declare CPAN distribution.

Report information
The Basics
Id: 45881
Status: resolved
Priority: 0/
Queue: Devel-Declare

Owner: Nobody in particular
Requestors: dcardwell [...]

Bug Information
Severity: (no value)
Broken in: 0.005001
Fixed in: (no value)

Subject: Can't use new keyword as a method name
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Type: text/plain
Charset: utf8
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 585
Download (untitled) / with headers
text/plain 585b
If you create a new keyword with Devel::Declare you can no longer call a method with the same name. The following examples croak with the error: Couldn't find declarator 'try' at /Library/Perl/5.8.8/darwin-thread-multi-2level/Devel/Declare/Context/ line 39 (replace "try" with "method" in the second example) # Example 1 use TryCatch; sub foo { my $bar = shift; return $bar->try(); } # Example 2 use MooseX::Declare; class Foo { has "method" => (is => ro, isa => Str, default => "foobar"); method bar { print $self->method, "\n"; } } 1;

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to