Create lists of number variables : Array Definition « Array « Perl






Create lists of number variables

    

#!/usr/bin/perl 
print "Content-Type: text/html \n\n"; 
# This script demonstrates how to create a numeric array. 
@AcmeInventory = (178,286,387); 
print @AcmeInventory; 
print "<p>We just created a list of numbers using an array variable!"; 

   
    
    
    
  








Related examples in the same category

1.Define an array variable called @myList.
2.Create lists of text variables
3.Arrays in Perl
4.Array literal
5.String array
6.Lists Assigned to Arrays
7.An array is a named list.
8.A program that reads data into an array and writes the array.
9.Build a string array across two lines
10.Construct a string array and output its first element
11.Construct an integer array and output its first element
12.Define two dimensional array
13.An empty list is represented as parentheses with nothing in between
14.Using qw to construct a string array
15.Constructing and Dereferencing