Skip Menu |
 

This queue is for tickets about the Scalar-List-Utils CPAN distribution.

Report information
The Basics
Id: 116962
Status: new
Priority: 0/
Queue: Scalar-List-Utils

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

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



Subject: Example get_code_info() doesn't work for explicitly unnamed subs
Download (untitled) / with headers
text/plain 738b
$ perl -MData::Dumper -MSub::Util=set_subname -MSub::Identify=get_code_info -e 'print Dumper [ get_code_info(set_subname "", sub {}) ]' $VAR1 = [ 'main', '' ]; $ perl -MData::Dumper -MSub::Util=subname,set_subname -e 'sub get_code_info { return (subname $_[0]) =~ m/^(.+)::(.+?)$/ }; print Dumper [ get_code_info(set_subname "", sub {}) ]' $VAR1 = []; With a slight tweak, this returns the same as Sub::Identify's get_code_info: $ perl -MData::Dumper -MSub::Util=subname,set_subname -e 'sub get_code_info { return (subname $_[0]) =~ m/^(.+)::(.*?)$/ }; print Dumper [ get_code_info(set_subname "", sub {}) ]' $VAR1 = [ 'main', '' ]; That is, replace the final (.+?) with (.*?).


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.