in reply to Perl script that will read two pdb files with different line numbers and will replace the chain letter from the first to the second file

if ($resnum1=$resnum)

Inside the brackets is an assignment. You almost certainly don't want to do that but instead test equality. ie:

if ($resnum1 == $resnum)

== is for comparing numbers and eq is for comparing strings.

Is there any particular reason you use those massive regexes in preference to a simple split? That might make things a little clearer. Other tips: use strict and warnings, replace print ... exit with die and try to use consistent indenting to make your code more legible (this really does help).

Good luck.

  • Comment on Re: Perl script that will read two pdb files with different line numbers and will replace the chain letter from the first to the second file
  • Select or Download Code