in reply to Recursive use causes subroutine redefinition
If you are going to use the same file both via use or require and as a main script or via do, you should manually put a "BEGIN { $INC{Module.pm} ||= __FILE__ }" in Module.pm before any possible use/require.$ cat>Baz.pm package Baz; use strict; use warnings; use Baz; sub baz { } 1; $ perl Baz.pm Subroutine baz redefined at Baz.pm line 5.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Recursive use causes subroutine redefinition
by prowler (Friar) on Sep 08, 2004 at 14:38 UTC |