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

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

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/ 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 infrastructure.

Please report any issues with to