while (<$fh>){ # Process the contents of the record # which is stored in $_ } close $fh or warn "Could not close $filename:$!";