in reply to Re: strict refs
in thread strict refs

I use strict; because it helps me avoid writing poor or ambiguous code.

While no-one else has persuaded me to use strict;, the general consensus of opinion, even in the DBI docs, is

To use DBI, first you need to load the DBI module: use DBI; use strict; (The use strict; isn't required but is strongly recommended.)

What I lack at the moment is the knowledge when (and sometimes how) to safely switch it off.

Replies are listed 'Best First'.
Re^3: strict refs
by Narveson (Chaplain) on Oct 28, 2008 at 17:19 UTC

    Strictures are lexically scoped, so if you turn them off in a small block, you are pretty safe.

    This particular example happens in a small foreach loop, so there's your block. If you're in the middle of a longer sequence, you can say

    do_stuff(); { no strict 'refs'; printf "%s=%d\n", $_, &{"DBI::$_"}; } do_more_stuff();