Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8817667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:54:20+00:00 2026-06-14T04:54:20+00:00

Below is a minimized example, where I have OA.pm (the parent object), OB.pm the

  • 0

Below is a minimized example, where I have OA.pm (the parent object), OB.pm the child object, and the runner script:

Object OB:

package OB;

use OA;
require Exporter;
@ISA = (Exporter, OA);
@EXPORT = ();

sub new {
    my $class = shift;

    print $class->SUPER;
    bless {}, $class;
};

1;

Object OA:

package OA;

require Exporter;
@ISA = (Exporter);
@EXPORT = ();

sub new {
    bless {}, shift;
};

1;

And the runner:

#!/usr/bin/perl

use strict;
use warnings;
use OB;

print OB->new;

When I run it, I got:

Can't locate object method "SUPER" via package "OB" at OB.pm line 10.

1) What could be wrong?

2) And what would the SUPER points to if I have more than one parent?

3) Was use OA mandatory?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:54:21+00:00Added an answer on June 14, 2026 at 4:54 am

    Unlike in Ruby, you must explicitly spell out the whole method you’re referring to.

    print $class->SUPER::new;
    

    That is assuming you wanted to call the method. If your intent is to figure out what parent class contains the new method, that’s complicated and I’m going to skip explaining how here.

    If your class has more than one parent, multiple inheritance, Perl normally looks through the parents depth first for a matching method. This is often problematic, and you can switch to the C3 method resolution order (mro) with use mro "c3" which avoids the diamond inheritance problem.

    More information on how SUPER and multiple inheritance.

    Finally, use OA or require OA was mandatory in order to load the OA class. You can load and inherit from a class in one line using use parent "OA".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is the code I tried: <script type=text/javascript> Ext.require(['*']); Ext.onReady(function() { Ext.Loader.setConfig({ enabled: true
The code below is (hopefully) a minimized testcase of my original problem. I'm trying
Below is the code from a plugin I use for sitemaps. I would like
I'm using jquery-1.4.2.min.js and jquery-ui-1.8.1.custom.min.js. According to Firebug, both minimized scripts have been loaded.
I have below code written in jQuery: var href = window.location.href; if (href.search('/welcome\\/') >
I have implemnted progressbar in my small game like below gameProgressBar =(ProgressBar)findViewById(R.id.GameProcess); thrd =
i have design similar to below given link. when i open this link and
Can a interrupt flag be set by the code as in the example below
I have an MDI form and several number of child forms inside that MDI.
I am trying to minimize the height of the table shown below. Firebug tells

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.