Place scalar variables in lists and arrays. : Array Scalar « Array « Perl






Place scalar variables in lists and arrays.

   

#!/usr/bin/perl -w


$element = "Ouch";

@array = ($element, 1, 2, 3, 4);

print "@array\n";

   
    
    
  








Related examples in the same category

1.Convert array to scalar
2.Assigning An Array To A Scalar
3.Use a scalar variable as our subscript:
4.Assign array variable to scalar variable
5.Split a scalar to create a list
6.Assign array value to a list of scalar variables
7.Assigning an array value to a scalar variabe
8.Reference single array element by using the $ not @
9.Scalar Data in an Array