Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Re: Teach him a lesson with facts

by theorbtwo (Prior)
on Feb 22, 2003 at 12:49 UTC ( #237723=note: print w/replies, xml ) Need Help??

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).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://237723]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2018-10-17 03:23 GMT
Find Nodes?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...

    Results (90 votes). Check out past polls.