- or download this
while (<>) {
if (/.../) {
push @matches, ...;
}
}
- or download this
while (<>) {
while (/.../g) {
push @matches, ...;
}
}
- or download this
my $file; { local $/; $file = <>; } # Slurp file.
while ($file =~ /.../g) {
push @matches, ...;
}