I've heard that Perl is the go-to language for string manipulation (and line noise ;). Can someone provide examples and comparisons with other language(s) to show me why?
Perl's very rich and powerful regular expression (regex) engine makes it easy to do basic string crunching, but by adding a few community-created modules, you can manipulate all kinds of text-based resources. In fact, we've put together a Perl 5.28 runtime environment to support just that.
The most popular scripting language in the world, Perl, is a superior text-processing language. Rexx also provides excellent string processing yet is much easier to learn and use.
Perl is very Unix-friendly. It can serve as a wrapper around Unix tools and is fully integrated into OS semantics. As a result, it excels at pipes, file slurping, inter-process communication, and other geeky tasks. It can create Unix daemons or server processes that run in the background.
It is very subjective, so I wouldn't say that Perl is the best choice, but it is certainly a valid choice for string manipulation. Other alternatives are Tcl, Python, AWK, etc.
I like Perl's capabilities because it has excellent support (better than POSIX as pointed out in the comment) for fast regexs and the implicit variables makes it easy to do basic string crunching with very little code.
If you have a *nix background a lot of what you already know will apply to Perl as well, which makes it fairly easy to pick up for a lot of people.
Perl -> Practical Extraction and Reporting Language
Perl's strength(when it comes to string processing) lies in it's very powerful Regular expression engine.
Because of this there are many people in the field of BioInformatics using Perl as their main tool, hence the large number of posts about BioPerl on PerlMonks . In BioInformatics they work with strings a lot , they call them "sequences"(I don't know much about this).
Perlmonks.org is the heart of the Perl community, check out the immense number of hits when you search for site:perlmonks.org regex 20,000 hits
You cannot ignore the sheer number of modules on CPAN:
This is very clear evidence that Perl is a very powerful language when it comes to string processing.
So if you want to do some string processing and you're using Perl, you've got it covered :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With