sub parse_profile {
my ($self, %params) = @_;
- my $profile;
- my $class;
- my $header;
my @specs;
+ my $csv_profile = $self->_csv->profile;
+ my $h_aref = ($self->_csv->is_multiplexed)? $self->_csv->header : [ $self->_csv->header ];
my $i = 0;
- foreach my $h (@{ $self->_csv->header }) {
- $header = $h;
- if ($self->_csv->profile) {
- $profile = $self->_csv->profile->[$i]->{profile};
- $class = $self->_csv->profile->[$i]->{class};
- }
-
- my $spec = $self->_parse_profile(profile => $profile,
- class => $class,
+ foreach my $header (@{ $h_aref }) {
+ my $spec = $self->_parse_profile(profile => $csv_profile->[$i]->{profile},
+ class => $csv_profile->[$i]->{class},
header => $header);
push @specs, $spec;
$i++;