in reply to Weird compilation success

Just to clarify - if A.pm is executed as a script it defines several methods, but does not add A to @INC. This is the root of the problem:
  1. B.pm looks at @INC (via either use or require), sees that A.pm is missing and tries to load it.
  2. A.pm gets loaded (it is not in @INC yet).
  3. Whilst loading A.pm, the perl compiler notices that those methods have already been defined in the namespace of A.
  4. Redefinition warnings are thus triggered.

See ikegami's post for a better way to pre-load from the command line.

Best, beth