[Boulder.pm] Trickey (for a newbie) String Replacement

Peter Hutnick pm at hutnick.com
Thu May 6 10:54:39 CDT 2004


Rob Nagler wrote:

> You ahve no philosophical clash with perl, whose philosophy is
> TIMTOWTDI.  However, you will bash up against the Perl Intelligentsia
> if you do this.

Like it or not, culture is part of the language . . .

> Implicit variables with dynamic scoping are simply bad programming.
> It's why I also write:
> 
>     use Bla::Module ();
> 
> If you don't do this, you have no idea where any of the names are
> coming from.  

I'm not following you here.  I've used getopts that way.  Maybe I just 
don't know the "bad" way?

> add a rule of the form:
> 
>    q{/\\(w+)/ && die($1, ': unhandled latex command')}

I plan to do exactly this as the default, and have a rule like 
s/\\.*?}//g for "pristine" mode.

> And, for a shameless plug, read the "It's a SMOP" chapter in my book
> which contains a DocBook/XML to HTML translator:
> 
> http://www.extremeperl.org/bk/its-a-smop

You might consider revising "subject matter oriented program evolves" in 
the first paragraph to "subject matter oriented program (SMOP) evolves."

Took me a while to figure out what the hell a SMOP is.

> It may help you simplify Luke's algorithm so that the rules are
> clearer and easier to maintain.

The rules are going to end up in a separate file that lives with the 
LaTeX file it works with.

As I said before, generality seems unachievable for this application. 
Laziness, in this case, is the better part of valor ;-)

-Peter



More information about the Boulder-pm mailing list