in reply to Parsing an RTF File as plain text.

Are you only printing this to a screen or to a file? Is it possible these files contain \r or \b characters? What if you added s/\s/ /g; after you chomp?

How should I handle RTF without using a module?

The only reliable way to do so is to read the (competing) specifications, experiment a lot, build up a comprehensive test suite, and consider some form of prayer and fasting. If the whitespace experiment doesn't fix things, you're probably much better off using a module.


Improve your skills with Modern Perl: the free book.

Replies are listed 'Best First'.
Re^2: Parsing an RTF File as plain text.
by Ekimino (Novice) on Apr 08, 2012 at 05:16 UTC
    The file did contain \r..\b ending lines, I read about it in the llama, but I couldn't find the exact page.

    For the record: The solution was to remove all types of whitespace as superdoc said. s/\s//g and adjust the code accordingly, thank you everyone for your time.