s_gaurav1091 has asked for the wisdom of the Perl Monks concerning the following question:

hi monks, I am working on a problem and i want to know that whether the general purpouse function init of shell::base be overloaded and if yes then how can it be overloaded
  • Comment on can a init function of shell::base be overloaded

Replies are listed 'Best First'.
Re: can a init function of shell::base be overloaded
by ikegami (Patriarch) on Jul 20, 2005 at 05:18 UTC

    According to the docs, the init method is "designed to be overridden by subclasses. The default init method in Shell::Base does nothing."

    You override it like any other method:

    package My::Shell; use Shell::Base; use base qw(Shell::Base); sub init { my ($self, $args) = @_; ... }