Help for this page

Select Code to Download


  1. 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"));
    
  2. or download this
    sub mk_tagger ($tag) {
        -> { "<$tag>$^txt</$tag>" }
    }
    
  3. 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"