Saurabh Singhvi wrote: > Hi all, Hello,
> The following code block > > foreach $protein (@pdbs) { > $rmsd[$i] = 0; > foreach $protein2 (@pdbs2) { > system("./TMalign $protein $protein2 | cgrep -i rmsd > What is cgrep? I don't have that on my system. > temp") == 0 or die $?; > open(TEMP,'temp') or die $?; If open fails there will be nothing useful in $?, you want to use the $! variable instead. > chomp($line = <TEMP>); > close TEMP; > ($length,$rmsd,$tm_score,$id) = split(/\,/,$line); > $rmsd =~ s/RMSD\=//; > $rmsd =~ s/\s//g; > $rmsd[$i] += $rmsd; > } > $i++; > } Perhaps this will work better: for my $protein ( @pdbs ) { my $temp; for my $protein2 ( @pdbs2 ) { open my $TEMP, "./TMalign $protein $protein2 |" or die "Cannot open pipe from 'TMalign' $!": while ( <$TEMP> ) { next unless /RMSD \s* = \s* ( \d+ )/ix; $temp += $1; last; } close $TEMP or warn $! ? "Error closing 'TMalign' pipe: $!" : "Exit status $? from 'TMalign'"; } push @rmsd, $temp; } > is giving error : > > open: null file name > apparent state: unit 10 named > last format: (A100) > lately reading sequential formatted external IO I searched through perldiag but I couldn't find that error message. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>