my %replaces = ( email => sub { "$_[1]" }, url => sub { "$_[1]'" }, # etc etc etc ); sub replace { my ($tag,$attr,$content) = @_; $attr ||= $content; return $replaces{$tag}->($attr,$content); } #### -- Joost downtime n. The period during which a system is error-free and immune from user input.