in reply to Creating A Custom Markup

I'm not sure exactly what your pretty-printing trouble is, but if you know your token will be at the start of the file, why not keep track of the indentation level, and prepend it to all inserted lines?
if (/(\t*)#&#(\w+)/) { my $indent = length($1); apply_template($2, $indent); }
Or you could run it all through W3C tidy at the end. :)

If you use File::Find (and you should), have a look at $File::Find::dir, or $File::Find::name. If you then use File::Spec (and you should), you can turn an absolute path into a relative path -- relative to the root directory under which you're recursing.

That all said, I definitely recommend picking up the Template Toolkit. You'll learn a lot rolling your own, but you'll probably paint yourself into a corner.