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
$ 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 (.*?).