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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:59:30+00:00 2026-05-26T16:59:30+00:00

I know @array[0,2,6] is an array with multiple values. And I was under the

  • 0

I know @array[0,2,6] is an array with multiple values.

And I was under the belief that $scalar=3 is a single variable with a single scalar value.

However, what is $array[3, 4]? Is it a scalar variable with two values?

  • 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-26T16:59:31+00:00Added an answer on May 26, 2026 at 4:59 pm

    @array[0,2,6] (or more generically @array[ EXPR ]) is an array slice. (See perldata) The index expression is evaluated in list context, the returned list is taken to be a list of indexes, and the elements identified by those indexes are returned by the slice.

    $array[ EXPR ] is an array element. The index expression is evaluated in scalar context, the returned value is taken to be an index, and the element identified by that index is returned.

    The code 3,4 evaluates to 4 in scalar context — See the comma operator in perlop — so $array[3,4] is the same as $array[4] except for a void context warning.

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

Sidebar

Related Questions

i know that if i were to be assigning values from multiple threads to
What's the best way to know when my array controller that is bound to
I know that C# supports covariance in arrays like this : object[] array =
Possible Duplicate: insert multiple rows via a php array into mysql I know about
I know how to validate a single checkbox, but what if I have multiple
How can I store multiple values in a single SQL field and ensure this
Are there performance disadvantages when I use a single-element array over a simple variable?
I would like to know how to get the values into this array. Can
I am trying to pass multiple values for a single field name to an
Possible Duplicate: Sort multidimensional array by multiple keys I want know how I can

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.