Posted By

Tagged

Process quoted text differently

This Perl snippet shows how to separate quoted parts from a text in order to process quoted and unquoted parts separately. For example, you could expand variables or wildcards only in the unquoted part. Then the different processed parts are put together again.

That a marker character "\x01" is used to mark the position of the quoted passages is a bit ugly, but on the other hand the single line of code putting the text together again is very elegant and shows off what Perl can do!