more useful options | |
PerlMonks |
AutoMagic HTMLby Cody Pendant (Prior) |
on Jun 24, 2003 at 03:03 UTC ( [id://268377]=perlquestion: print w/replies, xml ) | Need Help?? |
Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:
I'm working on code to render HTML automatically from text files.
What I'd like is for a text file containing just linebreaks and some special characters to be rendered as HTML by some regexes. I need to do three things:
So I can hack together regexes for each one of those, but I'm in TMTOWTDI mode at the moment, pondering various ways of doing it. I could work on the lines of the text file as an array, I could put them together as one long string, or I could do a bit of both -- say do the single-line ones iterating over the string then join() and do the multi-line ones. What do monks think? Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.
Back to
Seekers of Perl Wisdom
|
|