PERL Syntax Conditional Statements foreach

 

- Info:

- This tutorial shows how to use foreach conditional statement.

 

- Procedure:

- Create "PERL Application" Test.pl.

 

Test.pl

#Displays each string.

foreach $instrument ("violin","viola","cello","bass") {

print($instrument,"\n");

 }