title: How can I override a parent class function with child one in Perl?
body: <p>I would like to replace parent function (Somefunc) in child class, so when I call Main procedure it should fail.</p>
  
  <p>Is it possible in Perl?</p>
  
  <p>Code:</p>
  
  <pre><code>package Test;
  
  use strict;
  use warnings;
  
  sub Main()
  {
      SomeFunc() or die "Somefunc returned 0";
  }
  
  sub SomeFunc()
  {
      return 1;
  }
  
  package Test2;
  
  use strict;
  use warnings;
  
  our @ISA = ("Test");
  
  sub SomeFunc()
  {
      return 0;
  }
  
  package main;
  
  Test2-&gt;Main();
  </code></pre>