Mega Code Archive

 
Categories / Perl / Statement
 

Using foreach to loop through an array without using the default value

#!/usr/bin/perl -w use strict; my $element; foreach $element ('zero', 'one', 'two') {     print "the element is: $element\n"; }