in reply to Re: is use strict a compile time directive?
in thread is use strict a compile time directive?

I don't know which way it works out, but my answer is that it would be a horrible reason to not use strict.pm.

Sure, the (generally compile-time) checks that strict.pm invokes have to take some time. But the types of coding practices it discourages take more time at run-time. (Yes, it is faster to access a lexical variable than a global.) So it is hard to say which way the fraction of the second is going to go.

However there is no question that on any significant script you will save development time with strict.pm. And there is also no question that as a developer it is very important to come to understand that premature optimization is bad. So the question of how strict.pm plays out performance-wise is irrelevant to me, and should be irrelevant to any decent Perl programmer. The difference is small, it speeds development, and it assists in writing correct programs.

That is more than enough reasons to use it.

  • Comment on Re (tilly) 2: is use strict a compile time directive?

Replies are listed 'Best First'.
Re: (broquaint) 2: Re (tilly) 2: is use strict a compile time directive?
by broquaint (Abbot) on Oct 16, 2001 at 16:49 UTC
    I totally agree that leaving out use strict for the sake of speed is a bad thing(tm) and would never actually commit such a blasphemy myself. I merely wonder for the sake of furthering my Perl knowledge, and hoped to make the point you can always get a bit more speed if you're feeling a little mad. Leaving out use strict is about as useful as loop flattening and infinitely more dangerous (said ominously). Sorry if I've given anyone bad ideas, and yes, 'the voices' are generally wrong.
    HTH

    broquaint