use strict; use warnings; my @datan = qw(1 2 3 4 5 6); for my $element (@datan) { print "$element "; print "\n" if $element eq 3; }