Skip to content

Commit

Permalink
genbank_ref_extractor: move 'require's to GetOptions section (trying …
Browse files Browse the repository at this point in the history
…to predict all errors at the start)
  • Loading branch information
carandraug committed Sep 28, 2011
1 parent d314c39 commit b929a54
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions scripts/Bio-DB-EUtilities/bp_genbank_ref_extractor.pl
Expand Up @@ -157,13 +157,15 @@ sub proteins_option_parsing {
This options saves the data (gene UIDs, description, product accessions, etc) to
a file. As an optional value, the file format can be specified. Defaults to CSV.
Currently only CSV is supported
Currently only CSV is supported.
Saving the data structure as a CSV file, requires the installation of the Text::CSV module.
=cut
my $save_data = '';
sub save_data_option_parsing {
given ($_[1]) {
when (/^csv$/i) { $save_data = 'csv'; }
when ('') { $save_data = 'csv'; } ## Do nothing. If not set, use default
when (/^csv$/i) { $save_data = 'csv'; require Text::CSV; }
when ('') { $save_data = 'csv'; require Text::CSV; } ## Do nothing. If not set, use default
default { die "Specified format to save data '$save_data' is not valid."; }
}
}
Expand Down Expand Up @@ -878,15 +880,8 @@ sub save_structure {
}
}

=item *
Saving the data structure as a CSV file, requires the installation of the Text::CSV module.
=cut

sub create_csv {
my $struct = shift;
require Text::CSV;
my $csv = Text::CSV->new ({
binary => 1,
eol => $/,
Expand Down

0 comments on commit b929a54

Please sign in to comment.