in reply to Tkx and PERL_DL_NONLAZY

I found this and more detail at perl.com from March 2001. DL refers to the dynamic loader.

Setting [PERL_DL_NONLAZY] forces the loader to load up all functions at once, so that it can ensure that it really does have code for all the functions it claims to have code for; this is usually what you want to do when testing.

Here's another interesting one from perlrun

PERL_DL_NONLAZY Set to "1" to have Perl resolve all undefined symbols when it loads a +dynamic library. The default behaviour is to resolve symbols when the +y are used. Setting this variable is useful during testing of extensi +ons, as it ensures that you get an error on misspelled function names + even if the test suite doesn't call them.

Replies are listed 'Best First'.
Re^2: Tkx and PERL_DL_NONLAZY
by Kirsle (Pilgrim) on Jun 24, 2012 at 18:09 UTC
    Thanks for the info. I found that I can do this in a Tkx script to work around the problem:

    BEGIN {
        $ENV{PERL_DL_NONLAZY} = 1;
    }

    This enables one to just run the script as normal without setting the variable manually first. Is this variable okay to use in production code? It sounds to me like it would be analogous to "use strict", as in, it might mean a slight performance hit when starting Perl but it catches potential errors at compile time.