in reply to Suppressing Subroutine redefined warning
How are they defining the same subroutines? Are they defining subs in the same namespace, e.g. main? If so, that's probably not a good idea. If possible, you should have each package define the subs in its own namespace, and then use a classname to access the subs in one namespace or the other. Like so:
# Backend::A package Backend::A; sub foo { } 1;
# Backend::B package Backend::B; sub foo { } 1;
# main my $backend = 'Backend::A'; require $backend; $backend->foo(); # then later, if necessary: $backend = 'Backend::B'; require $backend; $backend->foo();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Suppressing Subroutine redefined warning
by philcrow (Priest) on Mar 27, 2006 at 20:22 UTC | |
by japhy (Canon) on Mar 27, 2006 at 20:35 UTC | |
by philcrow (Priest) on Mar 27, 2006 at 21:07 UTC |