Check out example codes for "perl array loop". It will help you in understanding the concepts better.

Code Example 1

# syntax
foreach my $<element-name> (@<array-name>) {
	# use $<element-name> in code
    print $<element-name> . "\n";
}

# example
my @YourArray = ("a","bb","ccc");
foreach my $element (@YourArray) {
   print $element . "\n";
}

Learn ReactJs, React Native from akashmittal.com