Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Perl provides many built-ins that implement algorithms that one might otherwise be tempted to write themselves. But nowadays, so do C++, Python, Ruby, and others. There is nothing about Perl that would prevent someone from writing just about any general purpose algorithm. It may not be the best choice for every problem domain, but there is no reason why it cannot be a good playground for implementing and learning about algorithms. Someone already mentioned the book, Mastering Algorithms with Perl. While the book is quite old, it is still an excellent source. I have a co-worker who recently implemented a compiler in Perl, complete with a lexer, parser, stack, heap, and a virtual cpu and runtime. It's not going to win any speed contests, but nothing about Perl prevented it from being a successful project for its intended purpose. However, when learning algorithms using any high level language, it's important to avoid the pitfall of Schlemiel the Painter. It is easy to learn the basics of a language like Perl or Python, yet miss the significance of what's going on under the hood. But again, just because the common use of a language such as Perl is to consume the high level tools of the language, those tools do not prevent you from learning algorithms. As an example, Perl has sort built in. But you could still write your own Merge Sort in Perl. There is seldom a need to write a Linked List in Perl, but Mastering Algorithms with Perl will walk you through it. Perl isn't the sort of language you would use to write a device driver, or a kernel. But it's just fine for learning algorithms, in my opinion. Dave In reply to Re: Learning Algorithms using Perl.
by davido
|
|