# unless it smells like </foo> or <foo bar="baz">
return File::Glob::glob($_[0]) unless (/^\/\w+$/ || /^\w+\s+\w+="/);
}
- return '<'.$_[0].'>';
+ return \('<'.$_[0].'>');
};
}
}
my ($class, $into, @tags) = @_;
foreach my $tag (@tags) {
no strict 'refs';
- tie *{"${into}::${tag}"}, 'XML::Tags::TIEHANDLE', "<${tag}>";
+ tie *{"${into}::${tag}"}, 'XML::Tags::TIEHANDLE', \"<${tag}>";
}
return sub {
foreach my $tag (@tags) {
sub quux {
use HTML::Tags;
- <html>, <body id="spoon">, "YAY", </body>, </html>;
+ <html>, <body id="spoon">, \"YAY", </body>, </html>;
}
}
is(
- join(', ', Foo::foo()),
+ join(', ', map ${$_}, Foo::foo()),
'<one>, <two>, <three>',
'open tags ok'
);
ok(!eval { Foo::bar(); 1 }, 'Death on use of unimported tag');
is(
- join(', ', Foo::baz()),
+ join(', ', map ${$_}, Foo::baz()),
'</bar>',
'close tag ok'
);
is(
- join('', Foo::quux),
+ join('', map ${$_}, Foo::quux),
'<html><body id="spoon">YAY</body></html>',
'HTML tags ok'
);