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

Code Example 1

#!/usr/bin/perl
use warnings;
use strict;

my @c = (1..6);
for(my $i = 0; $i <= $#c; $i++){
	print("$c[$i] \n");
}

Code Example 2

for ($i=0; $i<#whatever#; $i++){
	#your code
}

Learn ReactJs, React Native from akashmittal.com