- or download this
open FILE, '<', $file or die "...";
while (<FILE>) {
...
handle(FILE, 'that') if m/that/;
}
close FILE;
- or download this
open my {I/O}FILE, '<', $file or die "...";
while (<{I/O}FILE>) {
...
handle({I/O}FILE, 'that') if m/that/;
}
close {I/O}FILE;
- or download this
open my {I/O}FILE, '<', $file or die "...";
while (defined($_ = {I/O}FILE->readline)) {
...
handle({I/O}FILE, 'that') if $_ =~ m/that/;
}
{I/O}FILE->close;
- or download this
sub handle {
my $fh = shift;
...
...
}