Part of my code needs a list of URLs that are kept in a text message. Thanks to PodMaster
I found the right tool for finding the URLs in URI::Find
There is a small hitch, though: I want a function that returns an array of URLs. The synopsis for using URI::Find is this:
my $finder = URI::Find->new(\&callback);
$how_many_found = $finder->find(\$text);
Now, I could easily use the callback function to store the URLs in a global array variable. But what if I want them in an array that is local to the function calling URI::Find
? Is there any way to pass a reference to a target array to the callback function? Any other ideas I could try?