in reply to Re^2: Confused by use base, I think.
in thread Confused by use base, I think.

On a technical level, you are correct, but sometimes to wrap your head around an idea you present it in a way someone has to understand it. For someone who may not understand the difference you approach the idea in a way they can comprehend not the terminology they may or may not understand.

Replies are listed 'Best First'.
Re^4: Confused by use base, I think.
by ikegami (Patriarch) on Jun 15, 2008 at 15:26 UTC

    It's one thing to gloss over details. It's quite another to say that base doesn't create an inheritance relationship ("it looks like you are trying to base an object and hope that it inherits its methods, and that is not right.") and that its purpose is to make the following work ("Use base is intended to include code from another another package into your current one.")

    >type WWW.pm package WWW; sub www_func { print("woot!\n"); } 1; >type Admin.pm package Admin; use base 'WWW'; www_func(); 1; >perl -e"use Admin" Undefined subroutine &Admin::www_func called at Admin.pm line 3. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.

    And the OP's problem didn't even have anything to do with inheritance.

      Point taken and understood.