title: How do I inherit subroutines in Perl with 'use base'?
body: <p>How do I apply 'use base' in Perl to inherit subs from some base module?</p>
  
  <p>I'm used to C++ inheritance mechanics, and all the sites I googled for this caused more confusion then help. I want to do something like the following:</p>
  
  <pre><code>#! /usr/bin/perl
  #The base class to inherit from
  use strict;
  use warnings;
  
  package 'TestBase';
  
  #-------------------------------
  sub tbSub
  {
      my ($self, $parm) = @_;
      print "\nTestBase: $parm\n";
  }
  
  1;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>#! /usr/bin/perl
  #The descendent class
  use strict;
  use warnings;
  
  use base qw(TestBase);
  sub main;
  sub mySub;
  
  #-------------------------------
  #Entry point...
  main();
  
  #---code------------------------
  sub main
  {
      mySub(1);
      tbSub(2);
      mySub(3);
  }
  
  #-------------------------------
  sub mySub
  {
      my $parm = shift;
      print "\nTester: $parm\n";
  }
  </code></pre>
  
  <p>Perl complains/cannot find tbSub. </p>