in reply to Re^2: exists(&subname) causes strange autovivification problem
in thread exists(&subname) causes strange autovivification problem

no if $ARGV[0], "autovivification";

no MODULE LIST; is like use MODULE LIST, but calls a different method (unimport(LIST) instead of import(LIST)) - see no

if is a module named if, not your usual if, but the same idea. The if module accepts a condition, a module, and a (possible empty) argument list. If the condition is true, the if module loads the module passed after the condition and calls its import() or unimport() method.

All that glued together: if $ARGV[0] is true, call the unimport() method of autovivification. This disables autovivification if $ARGV[0] is true, at compile time.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^4: exists(&subname) causes strange autovivification problem
by Danny (Chaplain) on Nov 08, 2024 at 23:41 UTC
    Awesome, Thanks! Never heard of the "if" module but it seems pretty handy.