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

  • SEARCH
  • Home
  • 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 8080335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:22:56+00:00 2026-06-05T16:22:56+00:00

I have two nested packages that I am calling via fast_cgi. From the first

  • 0

I have two nested packages that I am calling via fast_cgi. From the first Package I am invoking a method from the second like so:

$MyScalar = "A Value";
MyPackage::Inner->InvokeMe($MyScalar);

From my other package, I’m unwinding the parameters like this:

sub ZonesByCustomer($)
{
    my $MyParameter = @_[0];
    print $MyParameter;
}

What I’d expect is to have A Value get printed out, however what is actually getting printed out is MyPackage::Inner. A Value is actually being stored in @_[1].

This seems confusing. Why is the package name getting returned as a parameter?

This is abstracted from my code. I can provide a slightly more complicated version if I am missing something here that is essential.

  • 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-05T16:22:57+00:00Added an answer on June 5, 2026 at 4:22 pm

    Perl doesn’t have a “this” variable (implied or otherwise) like many other languages, yet the method needs that information. Instead, Perl provides the class (static method call) or object (instance method call) as the first argument of the method. The result of evaluating the argument list follows.

    Example of static method requiring class name:

    sub new {
       my ($class, %args) = @_;
       return bless(\%args, $class);
    }
    
    SomeClass->new(...);
    

    Example of instance method requiring object:

    sub as_string {
       my ($self) = @_;
       return $self->{val};
    }
    
    $some_object->as_string();
    

    Note: @_[0] and @_[1] should be $_[0] and $_[1].

    Note: Prototypes are generally bad, and ignored during method calls. Get rid of it.

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

Sidebar

Related Questions

I have two nested loop in XSL like this, at this moment I use
I have a navigation bar that has two dropdowns (as nested ul's). I'm trying
how to implement inner outer classes in c# i have two nested classes like
In Rails 3 edge, I have set up two nested resources like this: config/routes.rb
I have a that contains two nested div's. One of the nested div's contains
Suppose you have two nested for loops like this: int i, j; // Iterators
Say I have two complex nested arrays in PHP, like these: $a = array(
I have a div which contains two nested divs, one that specifies a height
I have two repeater which are nested..Means there is one repeater and inside that
I have two divs that are not nested, one below the other. They are

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.