Subject: | Undefined errors |
Hi,
I'm getting undefined variable errors with Template::Plugin::AutoLink.
I'm currently using the module with Catalyst running under mod_perl 2.
I've attached a patch that fixes those errors.
Thanks
Rob
Subject: | AutoLink.patch |
--- AutoLink.pm 2010-04-30 09:19:17.000000000 +0100
+++ /usr/lib/perl5/site_perl/5.8.5/Template/Plugin/AutoLink.pm 2010-04-29 15:58:13.000000000 +0100
@@ -66,15 +66,17 @@
my $result = '';
my $skip = 0;
while ($str =~ /($TextRe)($TagRe)?/gso) {
- last if $1 eq '' and $2 eq '';
- my $text_tmp = $1;
- my $tag_tmp = $2;
+ my $text_tmp = $1 || '';
+ my $tag_tmp = $2 || '';
+ last if $text_tmp eq '' and $tag_tmp eq '';
if ($skip) {
$result .= $text_tmp . $tag_tmp;
$skip = 0 if $tag_tmp =~ /^<\/[aA](?![0-9A-Za-z])/;
} else {
$text_tmp =~ s{$UrlRe}
- {my($org, $mail) = ($1, $2);
+ {
+ my $org = $1 || '';
+ my $mail = $2 || '';
(my $tmp = $org) =~ s/"/"/g;
$anchor . ($mail ne '' ? 'mailto:' : '') . "$tmp\">$org</a>"}ego;
$result .= $text_tmp . $tag_tmp;
@@ -124,4 +126,3 @@
it under the same terms as Perl itself.
=cut
-