Help for this page

Select Code to Download


  1. or download this
    $ perl -MAA -e 'AA->mysub()'
    AA
    BB
    
  2. or download this
    perl -MBB -e 'AA->mysub()'
    The method 'mysub' was not found in the inheritance hierarchy for AA a
    +t /usr/local/lib/perl/5.14.2/Class/MOP/Class.pm line 1053.
    ...
    Compilation failed in require.
    BEGIN failed--compilation aborted.
    
  3. or download this
    package AA;
    use utf8;
    ...
        print "AA\n";
        shift->();
    };
    
  4. or download this
    package BB;
    use utf8;
    ...
    use CC;
    
    sub mysub { print "BB\n";}
    
  5. or download this
    package CC;
    
    use AA;
    1;
    
  6. or download this
    $ perl -MBB -e 'AA->mysub()'
    AA
    BB
    
  7. or download this
    package AA;
    use utf8;
    ...
        shift->SUPER::mysub();
    };
    
  8. or download this
    package BB;
    use utf8;
    ...
    
    sub mysub { print "BB\n";}
    1;
    
  9. or download this
    package CC;
    
    use AA;
    1;