Skip Menu |
 

This queue is for tickets about the Sub-Documentation CPAN distribution.

Report information
The Basics
Id: 102282
Status: new
Priority: 0/
Queue: Sub-Documentation

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

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



Subject: Cannot use attributes for anonymous subroutines
Download (untitled) / with headers
text/plain 713b
When using Sub::Documentation::Attributes with anonymous subroutine, an error is thrown: Can't use string ("ANON") as a symbol ref while "strict refs" in use at .../Sub/Documentation/Attributes.pm line 23 Simple reproduce: perl -MSub::Documentation::Attributes -e '$sub = sub :Purpose(foobar) { ... }' My suggestion is to use the string representation of the anonymous subref as the name. my $name = $symbol eq 'ANON' ? "$referent" : *{$symbol}{NAME}; add_documentation( package => $package, glob_type => ref($referent), name => $name, type => $type, documentation => $data, ); So the documentation is still searchable.


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.