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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:39:46+00:00 2026-05-18T12:39:46+00:00

lets say i have an array : @time = qw( 1 2 3 4

  • 0

lets say i have an array :

@time = qw(
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
);

but the values 1..50 depend on the size of an array @arr

so instead of declaring @time manually, how can i populate @time with 1 .. @arr, and possibly have other TYPES of elements like TIME in seconds, etc.

  • 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-18T12:39:46+00:00Added an answer on May 18, 2026 at 12:39 pm

    This will initialise @time with the values from 1 to $#arr:

    @time = (1..$#arr);
    

    I suspect you probably want 0 .. $#arr rather than 1 .. $#arr?

    and possibly have other TYPES of elements like TIME in seconds, etc.

    I’m not quite sure what you mean here, but you should have a look at map for one convenient way of generating a list of values by transforming another list. That might be what you’re after.

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

Sidebar

Related Questions

Lets say I have an array like this: string [] Filelist = ... I
Lets say I have this array, int[] numbers = {1, 3, 4, 9, 2};
Let's say I have an array of lots of values (C++ syntax, sorry): vector<double>
I have a 2D bitmap-like array of let's say 500*500 values. I'm trying to
Lets say I have an array [0, 132, 432, 342, 234] What is the
Lets say I have the following array: Array ( [1284487200] => Array ( [title]
Lets say that I have an array that I want to convert to a
i have an array lets say x = 1 2 2 5 8 7
This has been bothering me for a long time now: Lets say i have
Let's say I have the following array: arr = [[5, 1], [2, 7]] and

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.