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