All pastes #44840 Raw Edit

Anonymous

public text v1 · immutable
#44840 ·published 2006-03-08 00:49 UTC
rendered paste body
sub translate_template 
  {
    my (@tmpl, %rules) = ($$_[0], $$_[1]);
    my $str = "";

    for (@tmpl)
      { 
        s{/}{};
        $str .= "/".((exists $rules{$_}) ? $rules{$_} : $_);
        exists $rules{$str} and $str = $rules{$str};
      }

    return $str;
  }