Skip to content

Commit f9e8593

Browse files
committed
fix linting issues
1 parent 46ff305 commit f9e8593

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/SGN/Controller/BreedersToolbox/Download.pm

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ sub breeder_download : Path('/breeders/download/') Args(0) {
185185
sub _parse_list_from_json {
186186
my $list_json = shift;
187187
# print STDERR "LIST JSON: ". Dumper $list_json;
188-
my $json = new JSON;
188+
my $json = JSON->new();
189189
if ($list_json) {
190190
# my $decoded_list = $json->allow_nonref->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($list_json);
191191
my $decoded_list = decode_json($list_json);
@@ -634,26 +634,26 @@ sub download_action : Path('/breeders/download_action') Args(0) {
634634
if ($format eq ".csv") {
635635

636636
#build csv with column names
637-
open(CSV, "> :encoding(UTF-8)", $tempfile) || die "Can't open file $tempfile\n";
637+
open(my $csv_fh, "> :encoding(UTF-8)", $tempfile) || die "Can't open file $tempfile\n";
638638
my @header = @{$data[0]};
639639
my $num_col = scalar(@header);
640640
for (my $line =0; $line< @data; $line++) {
641641
my @columns = @{$data[$line]};
642642
my $step = 1;
643643
for(my $i=0; $i<$num_col; $i++) {
644644
if (defined($columns[$i])) {
645-
print CSV "\"$columns[$i]\"";
645+
print $csv_fh "\"$columns[$i]\"";
646646
} else {
647-
print CSV "\"\"";
647+
print $csv_fh "\"\"";
648648
}
649649
if ($step < $num_col) {
650-
print CSV ",";
650+
print $csv_fh ",";
651651
}
652652
$step++;
653653
}
654-
print CSV "\n";
654+
print $csv_fh "\n";
655655
}
656-
close CSV;
656+
close $csv_fh;
657657

658658
} else {
659659
my $ss = Excel::Writer::XLSX->new($tempfile);
@@ -769,7 +769,7 @@ sub download_accession_properties_action : Path('/breeders/download_accession_pr
769769
my $file_name = basename($file_path);
770770

771771
# Write to csv file
772-
open(CSV, "> :encoding(UTF-8)", $file_path) || die "Can't open file $file_path\n";
772+
open(my $csv_fh, "> :encoding(UTF-8)", $file_path) || die "Can't open file $file_path\n";
773773
my @header = @{$rows->[0]};
774774
my $num_col = scalar(@header);
775775

@@ -778,18 +778,18 @@ sub download_accession_properties_action : Path('/breeders/download_accession_pr
778778
my $step = 1;
779779
for ( my $i = 0; $i < $num_col; $i++ ) {
780780
if ($columns->[$i]) {
781-
print CSV "\"$columns->[$i]\"";
781+
print $csv_fh "\"$columns->[$i]\"";
782782
} else {
783-
print CSV "\"\"";
783+
print $csv_fh "\"\"";
784784
}
785785
if ($step < $num_col) {
786-
print CSV ",";
786+
print $csv_fh ",";
787787
}
788788
$step++;
789789
}
790-
print CSV "\n";
790+
print $csv_fh "\n";
791791
}
792-
close CSV;
792+
close $csv_fh;
793793

794794
# Return the csv file
795795
$c->res->content_type('text/csv');

t/lib/SGN/Test/Fixture.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ sub dbic_schema {
161161
return $self->people_schema();
162162
}
163163

164-
return undef;
164+
return;
165165
}
166166

167167
sub get_conf {

0 commit comments

Comments
 (0)