Commit d07bf3d9 authored by Magali Ruffier's avatar Magali Ruffier
Browse files

fixed for Perl critic

parent 10eaf6bf
...@@ -167,7 +167,7 @@ sub new { ...@@ -167,7 +167,7 @@ sub new {
$self->driver($driver); $self->driver($driver);
my $driver_class = 'Bio::EnsEMBL::DBSQL::Driver::' . $driver; my $driver_class = 'Bio::EnsEMBL::DBSQL::Driver::' . $driver;
eval "require $driver_class"; eval "require $driver_class"; ## no critic
throw("Cannot load '$driver_class': $@") if $@; throw("Cannot load '$driver_class': $@") if $@;
my $driver_object = $driver_class->new($self); my $driver_object = $driver_class->new($self);
$self->_driver_object($driver_object); $self->_driver_object($driver_object);
......
...@@ -1572,7 +1572,8 @@ sub finish_log { ...@@ -1572,7 +1572,8 @@ sub finish_log {
$self->log($self->date_and_mem."\n\n"); $self->log($self->date_and_mem."\n\n");
} }
if($self->param('joblog')) { if($self->param('joblog')) {
unless(open(JOB,'>',$self->param('joblog'))) { my $fh;
unless(open($fh,'>',$self->param('joblog'))) {
$self->log_warning("Could not log job to '".$self->param('joblog'). $self->log_warning("Could not log job to '".$self->param('joblog').
"': $!"); "': $!");
return 1; return 1;
...@@ -1587,9 +1588,9 @@ sub finish_log { ...@@ -1587,9 +1588,9 @@ sub finish_log {
push @keys,"END",time; push @keys,"END",time;
while(@keys) { while(@keys) {
my ($k,$v) = splice(@keys,0,2); my ($k,$v) = splice(@keys,0,2);
print JOB "$k: $v\n"; print $fh "$k: $v\n";
} }
close JOB; close $fh;
} }
return(1); return(1);
} }
...@@ -2157,9 +2158,9 @@ sub save_seq { ...@@ -2157,9 +2158,9 @@ sub save_seq {
my $self = shift; my $self = shift;
my $content = shift ; my $content = shift ;
my $seq_file = $self->param('logpath') . '/SEQ_' . time() . int(rand()*100000000) . $$; my $seq_file = $self->param('logpath') . '/SEQ_' . time() . int(rand()*100000000) . $$;
open (TMP,">$seq_file") or die("Cannot create working file.$!"); open (my $fh,">$seq_file", $seq_file) or die("Cannot create working file.$!");
print TMP $content; print $fh $content;
close TMP; close $fh;
return ($seq_file); return ($seq_file);
} }
...@@ -2202,10 +2203,11 @@ sub get_alignment { ...@@ -2202,10 +2203,11 @@ sub get_alignment {
$out_file = $self->param('logpath').'/' . $out_file . '.out'; $out_file = $self->param('logpath').'/' . $out_file . '.out';
my $command; my $command;
my $fh;
if ($seq_type eq 'DNA') { if ($seq_type eq 'DNA') {
$command = sprintf $dnaAlignExe, $int_seq_file, $ext_seq_file, $out_file; $command = sprintf $dnaAlignExe, $int_seq_file, $ext_seq_file, $out_file;
`$command`; `$command`;
unless (open(OUT, "<$out_file")) { unless (open($fh, "<", $out_file)) {
$command = sprintf $dnaAlignExe, $int_seq_file, $ext_seq_file, $out_file; $command = sprintf $dnaAlignExe, $int_seq_file, $ext_seq_file, $out_file;
`$command`; `$command`;
} }
...@@ -2213,12 +2215,12 @@ sub get_alignment { ...@@ -2213,12 +2215,12 @@ sub get_alignment {
elsif ($seq_type eq 'PEP') { elsif ($seq_type eq 'PEP') {
$command = sprintf $pepAlignExe, $int_seq_file, $ext_seq_file, $label_width, $output_width, $out_file; $command = sprintf $pepAlignExe, $int_seq_file, $ext_seq_file, $label_width, $output_width, $out_file;
`$command`; `$command`;
unless (open(OUT, "<$out_file")) { unless (open($fh, "<", $out_file)) {
$self->log_warning("Cannot open alignment file\n"); $self->log_warning("Cannot open alignment file\n");
} }
} }
my $alignment ; my $alignment ;
while (<OUT>) { while (<$fh>) {
next if $_ =~ next if $_ =~
/\#Report_file /\#Report_file
|\#----.* |\#----.*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment