programming-examples/perl/SystemFunction/Using scalar function to convert array to scalar variable.pl

8 lines
152 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/bin/perl -w
use strict;
my @array = qw(A B C D);
print "Scalar value : ", scalar(@array), "\n";
print "Highest index: ", $#array, "\n";