The current implementation is based upon LaTeX::TOM (the framework being
used for parsing the LaTeX source) and its clear distinction between various
types of nodes. As an example, a \chapter command has a separate text
associated with it as its content. LaTeX::Pod uses a look-behind mechanism
for commands and their corresponding texts since they currently cannot be easily
detected without such a mechanism.
Thus LaTeX::Pod was designed with the intention to be context-sensitive
aware. This is also being aimed at by eventually registering which type of node
has been seen before the current one useful when constructing logical paragraphs
made out of two or more nodes. LaTeX::Pod then finally unregisters the type
of node seen when it is no longer required. In addition, a dispatch queue is built
internally which is executed after all nodes have been processed.
Considering that the POD format has a limited subset of directives, the complexity
of keeping track of node occurences appears to be bearable. Leading and trailing
newlines will be removed from the nodes text extracted where needed; furthermore,
trailing spaces and tabs will also be purged from each line of POD resulting.