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 6602199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:50:55+00:00 2026-05-25T18:50:55+00:00

How to expand hash into argument list in function call in Perl? I am

  • 0

How to expand hash into argument list in function call in Perl? I am searching Perl equivalent of Python’s syntax : somefunc(**somedict) or somefunc(*somelist). Is that possible in Perl?

  • 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-05-25T18:50:55+00:00Added an answer on May 25, 2026 at 6:50 pm

    In Perl, all function arguments are passed as lists and stored in the special array variable @_. You can copy those values to some other array, or directly into a hash (as you can with any array/list).

    If you are writing a function, you can pass the arguments directly into an array or hash:

    sub hashFunc {
        my %args = @_;
    
        ....
    }
    
    sub arrayFunc {
        my @args = @_;
    
        ...
    }
    

    To call a function like that, just pass them as if they were a list or hash:

    hashFunc(arg1 => 'someVal', arg2 => 'someOtherVal');
    arrayFunc('someVal', 'someOtherVal');
    

    If you already have the arguments in a variable, just pass them along and Perl flattens out the array/hash into the argument list:

    hashFunc(%someHash);
    arrayFunc(@someArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question will expand on: Best way to open a socket in Python When
I'm trying to expand my sons interest from Warcraft 3 programming into C++ to
How to expand this query: public Dictionary<int, List<TasksInDeal>> FindAllCreatedTasks() { return (from taskInDeal in
I'm trying to expand on an idea from someone else's question, and running into
People say it takes amortized O(1) to put into a hash table. Therefore, putting
Recently I refactored the code of a 3rd party hash function from C++ to
How to expand drop down list (listed items). I cant able to view the
Recently I decided to expand my programming horizons and learn the python programming language.
{%{$self->param}} It does hash expand, and then create another hash reference. But isn't {%{$self->param}}
I want to expand my programming horizons to Linux. A good, dependable basic toolset

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.