sub menucolor { my $stuff = join '', @_; my ($ls, $le, $ts, $te) = ($Q->start_font({-color => $Page{'owner'}{'MenuLink'}}), $Q->end_font, $Q->start_font({-color => $Page{'owner'}{'MenuText'}}), $Q->end_font); $stuff = "<>$stuff<>" if $stuff !~ /^<.*>$/; #color links link color $stuff =~ s/(]*?>)([^<]+)/$1$ls$2$le/ig; #color everything currently uncolored text color $stuff =~ s/(>)([^<]+)/$1$ts$2$te/ig; #doesn't yet do what it's supposed to return $stuff; }