perl array

#!/usr/bin/perl

@ages = (25, 30, 40);             
@names = ("John Paul", "Lisa", "Kumar");

print "\$ages[0] = $ages[0]\n";
print "\$ages[1] = $ages[1]\n";
print "\$ages[2] = $ages[2]\n";
print "\$names[0] = $names[0]\n";
print "\$names[1] = $names[1]\n";
print "\$names[2] = $names[2]\n";

3.5
2

                                    $ages[0] = 25
$ages[1] = 30
$ages[2] = 40
$names[0] = John Paul
$names[1] = Lisa
$names[2] = Kumar

3.5 (2 Votes)
0
Are there any code examples left?
New code examples in category Perl
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
perl how to get array perl how to make array perl array with arrays =~ perl arrays perl array po %array perl perl define array perl $#array is array perl in array perl array of array in perl perl size of array perl an array of array arrays perl perl in array perl return array make variable from array index perl perl make variables from array perl make array indexes variables array in perl perl assign all elements of an array to a string variable perl print array elelemnts as a string array perl perl element in array array of strings perl pop the element from the specific index number in perl perl create array perl get array element Can we use different data types for the elements of an array ? in perl explain this code in perl print $size=$#array + 1; declare array in perl perl arrayy arr in perl perl ARRAY(0x25e81e8) perl is array perl print array index how to make an array perl perl print array value {x}=>1 perl perl symbol to initialize array variables perl set array array of string in perl how to declare array in perl perl access an array value perl access array element building an array perl perl declare array perl contents of ARRAY(0x56086013ebc8) create array perl perl define array variable arrays in perl ARRAY(0x55cbc00153f0) perl array not displaying how to get different element in the array in perl perl array array inperl perl arrays how to declare an array in perl string variable to array perl how to use array elements in perl perl make array perl decare array perl array
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source