Convert array to scalar : Array Scalar « Array « Perl






Convert array to scalar

    

#!C:/perl/bin

@passengerships = ('T', 'O', 'B');
print "@passengerships \n";
print scalar(@passengerships);

   
    
    
    
  








Related examples in the same category

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