Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ima23 committed Oct 15, 2018
1 parent 0dc444d commit b853ed9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions POSTGAP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,18 @@ sub new {

# get required columns
my $all =0;
my $i = 1;
my $i = 4;
while(defined($self->params->[$i])) {
my $col = $self->params->[$i];
if($col eq 'ALL') {
$i =4;
$self->{cols} = {map {$_ => $i++}
grep {!defined($self->{cols}->{$_})} #only the extra columns
@{$self->{headers}}};
last;
}
die "ERROR: Column $col not found in header for file $file. Available columns are:\n".join(",", @{$self->{headers}})."\n" unless grep {$_ eq $col} @{$self->{headers}};

$self->{cols}->{$self->params->[$i]} = 3+ $i;
$self->{cols}->{$self->params->[$i]} = $i;
$i++;
}

Expand Down

0 comments on commit b853ed9

Please sign in to comment.