#!perl -w use strict; use Text::Xslate qw(html_builder html_escape); use URI::Find 20100505; my $text = <<'EOT'; EOT my $finder = URI::Find->new(sub { my($obj_uri, $orig_uri) = @_; my $safe_uri = html_escape($orig_uri); return qq|$safe_uri|; }); my $tx = Text::Xslate->new( function => { autolink => html_builder { my($text) = @_; $finder->find(\$text, \&html_escape); return $text; }, }, ); print $tx->render_string(<<'T', { text => $text }); : $text | autolink T