in reply to Re: Teach him a lesson with facts
in thread Teach him a lesson with facts

Perl is very difficult to optimize. For example, take the code

for (0..1_000_000) { $x=$_+1; }
(Take my code, please!) In C, the equivlent code would be equivlent to x=1000001. In perl, you can't do that optimization, because $x might be tied, in which case, writing to it might have side effects. In C, you'd have to declare that, using the volitile keyword. In perl, there's no way to tell, so the compiler can't assume anything.
Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).