I think your question depends largely on what you need to do with your program. C is great for times when you need to be close to the bare metal, but it's difficult to use and can get you into a world of trouble fairly easily. Pointers can be fun and powerful, but they really give you a whole lot of rope with which to hang yourself. You should see my poor neck ;-)
To my understanding, C would be faster to run for most uses. It compiles to machine code, as opposed to Perl compiling to byte code. This won't matter if you're waiting for a keypress, but in graphics and heavy math, the difference may be crucial.
The thing is, it takes much longer to develop working code in C. Imagine what is involved in creating, filling, and sorting a hash. A competent Perl programmer could knock it out in a few minutes. A Perl wizard could probably write a one-liner. A good C programmer would probably need an hour or more to accomplish the same thing.
In general, I'd use Perl for just about everything, because it is so easy to use (and fun). And because if I get stuck, I can always come here to Perl Monks and get an answer within minutes (usually). If I were trying to do something with heavy graphics use, hairy math (matrices, for example), any sort of time-consuming stuff, and if there were going to be large iterations of things, I'd probably bite the bullet and write at least those parts in C. So far, I haven't found anything that has required me to do this. Perl has worked just fine for everything I've needed, even digesting megabytes of text and spewing it out all neatly organized. I'm glad C is available, "just in case", but I hope I'll never need it.
In reply to Re: (OT) perl cmp c
by spiritway
in thread (OT) perl cmp c
by leocharre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |