- or download this
sub mk_tagger {
my($tag) = @_;
...
my ($bold, $underline, $italic) = map { mk_tagger($_) } qw( b u i );
print $bold->("what a " . $underline->("nice") . $italic->(" day"));
- or download this
sub mk_tagger ($tag) {
-> { "<$tag>$^txt</$tag>" }
}
- or download this
tagStr :: String -> String -> String
tagStr tag text = "<" ++ tag ++ ">" ++ text ++ "</" ++ tag ++ ">"
...
tagStr "b" "a bold moose"
underline = tagStr "u"
underline "an underlined moose"