On 09/21/2006 04:52 AM, Saurabh Singhvi wrote:
Hi all,

The following code block


is written without strictures and warnings enabled. If you place these lines,
  use strict;
  use warnings;
at the top of your program, you'll catch errors much more quickly. In particular, "use strict" will force you to declare your variables before using them, which can prevent some kinds of bugs.

foreach $protein (@pdbs) {
       $rmsd[$i] = 0;
       foreach $protein2 (@pdbs2) {
               system("./TMalign $protein $protein2 | cgrep -i rmsd >
temp") == 0 or die $?;

                # Replace the above line with the:
open (TEMP, "-|", "./TMalign $protein $protein2 | cgrep -i rmsd") or die $!;

               chomp($line = <TEMP>);
               close TEMP;
               ($length,$rmsd,$tm_score,$id) = split(/\,/,$line);
               $rmsd =~ s/RMSD\=//;
               $rmsd =~ s/\s//g;
               $rmsd[$i] += $rmsd;
       }
       $i++;
}

is giving error :

open: null file name
apparent state: unit 10 named
last format: (A100)
lately reading sequential formatted external IO


What OS and filesystem is this?

Now if i use exec instead of system, things work. But then the code ends
because of exec, and that isn't what i need.

if som1 can plz tell me what the problem is :(

thanks
Saurabh


Try the open command I wrote, and see if that works. I hope this helps.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to