I think, this is a huge overkill :) Imagine, we'd have to compose a Tie::FooThing package every time we face a simple branching algorithm?
What this guy needs is probably some good intro into regexen and some good example variants of code, like
tachyon provided.