Without writing the code for you, here's an outline of what your code needs to do:
- Open PDB file for reading
- Read each line consecutively
- If line DOES NOT begin with "ATOM" or "HETATM", print it
- If line DOES begin with ATOM or HETATM:
- extract the number in the column that corresponds to X coordinate
- add 10 to it
- print out line, substituting new X value
- Close PDB file
So the main Perl concepts that you need to learn are:
- how to open, close and read a file; then print lines from it
- how to match regular expressions to a line
- how to split space-delimited lines into arrays
- basic arithmetic on variables ("add 10 to x")
A lot of this is covered by answers to a previous question. But really, it's probably better to use an existing parser which will have considered the difficult cases (see Bosco's comment).
Basically, what you're asking is how to access the coordinate section of a PDB file. Lots of answers to this question.