- or download this
for (@words) {
print if /foo/;
}
- or download this
my $s = "foo";
for (@words) {
print if /$s/;
}
- or download this
my($s1, $s2) = qw/ foo bar /;
for (@words) {
print if /$s1/;
print if /$s2/;
}
- or download this
my @s = qw/ foo bar /;
for (@words) {
...
print if /$s/;
}
}
- or download this
my @s = map qr{$_}, qw/ foo bar /;
for (@words) {
...
print if /$s/;
}
}