If choosecat is really in its own package, and it's a different package from login, you shouldn't have any trouble. The different packages provide different namespaces, so Perl will know the subs are different. If neither declares a package, they'll both run in main, in which case something like &choosecat::load; won't work, since there's no such package as choosecat.
If both run in package main, you can work around this by temporarily creating a new package, then loading in choosecat.cgi in that package:
.eval { package choosecat; require "choosecat.cgi"; &choosecat::test; };
That said, I agree with the other posters that refactoring your code so that functions needed by more than one program are in a seperate library is probably what you really want to do.
In reply to Re: subroutine redefined error when switching scripts
by sgifford
in thread subroutine redefined error when switching scripts
by lpoht
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |