- or download this
my $goal = 'over';
my @array = qw(the quick fox jumped over the lazy dog);
foreach my $item (@array) {
next unless $item =~ /$goal/;
print $item;
}
- or download this
my $goal = 'over';
my @array = qw(the quick fox jumped over the lazy dog);
for (@array) {
...
print $_;
last
}
- or download this
my $goal = 'over';
my @array = qw(the quick fox jumped over the lazy dog);
my $found_item;
...
print $found_item;
# do other stuff
}
- or download this
my $goal = 'over';
my @array = qw(the quick fox jumped over the lazy dog);
my $found;
...
last;
}
}