Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: calculate distance between atoms and a target atom

by hippo (Deacon)
on Dec 02, 2013 at 22:15 UTC ( #1065330=note: print w/ replies, xml ) Need Help??


in reply to calculate distance between atoms and a target atom

Don't use this sort of construct:

if ($pdbline =~ /OD2 ASP/ or /NE2 HIS/)

You are testing 2 possibilities here. The first one is $pdbline =~ /OD2 ASP/ which may be fine, but the second one is /NE2 HIS/ which by default will test $_ which is probably not what you want. Either combine the 2 regular expressions into 1 (left as an exercise) or test them individually like this:

if ($pdbline =~ /OD2 ASP/ or $pdbline =~ /NE2 HIS/)

The "Use of uninitialized value" reports you see are warnings, not errors. However, the fact that they are presented to you indicates that you are attempting to do something with an uninitialised value which is usually not what you intend.

In this specific case, your references to items like $x1[$Znx] on line 58 will give that if the $Znx is uninitialised. You will need to trace through the logic to see how that might happen and correct it.

Best advice is:

  • use strict; # Always
  • Lose the prototypes unless you have a very, very good reason for keeping them.
  • Don't use "or" like you were.

Best of luck with the rest of it.


Comment on Re: calculate distance between atoms and a target atom
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1065330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2014-07-26 20:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (179 votes), past polls