lots of existing code
There is a lot of existing code you can pull in from CPAN. Pretty much anything you want has been done,
The hard bit is regular expressions used to fiddle with text.
It is ugly, But if you need it, it is powerful. The alternative of rolling your own code to pattern match in strings is much worse - particulary if you may need to work with ascii and unicode and other text coding schemes. That is why Linux is strung together with perl scripts. You know you will find it on any Linux machine.