#!/usr/bin/perl -Tw use URI::Find; use strict; my $text = " ... long string with lots of URLs ... "; my @urls; find_uris($text, sub { my ($uri, $orig_uri) = @_; push @urls, $orig_uri; }); print join("\n", @urls), "\n"; exit 0;