Subject: | new requires code ref |
I just read the Advent http://www.perladvent.org/2002/1st/ and this simple example fails:
use URI::Find::Schemeless; # v0.13
my $text = "some text, www.washington.edu";
my $finder = URI::Find::Schemeless->new();
my $matches = $finder->find(\$text);
with this error message:
Use of uninitialized value in subroutine entry at /usr/lib/perl5/site_perl/5.6.0/URI/Find.pm line 126.
Can't use string ("") as a subroutine ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.6.0/URI/Find.pm line 126.
This implies that new() requires a code ref. A simple work-around ( e.g. new(sub {}) ) will do, but initializing with an empty code ref, or using defined would be better.