open my $fh, '<', 'path/to/my/PDB/file' or die "Could not open PDB file: $!"; while (<$fh>) { ... }