The difference is that use executes the module's code at compile time, basically making $File::Find::prune known earlier than with require, which executes at runtime. One really simple workaround is to use the variable twice: $File::Find::prune = $File::Find::prune = 1; (Update: Of course this removes typo protection if you happen to make the same typo twice, e.g. if you used copy&paste on the variable name.)
In reply to Re: Why $File::Find::prune = 1 returns used only once error
by haukex
in thread Why $FIle::Find::prune = 1 returns used only once error
by h2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |