perl foreach loop

176

perl foreach loop -

# Basic syntax:
foreach var (list) {
	code to run;
}

# Example usage:
@list = (2, 20, 30, 40, 50);
foreach $i (@list) {
    print "Value of i: $i\n";
}

Comments

Submit
0 Comments