- my $choice = 0;
- if($itemstatusloopcount == 1){ $choice = 1;}
- foreach my $data (@serialslist){
- if (scalar(@itemstatusloop)){$data->{"itemstatusloop"}=\@itemstatusloop;}
- else { $data->{"itemstatusloop"}=[];}
- if (scalar(@itemlocationloop)){$data->{"itemlocationloop"}=\@itemlocationloop;}
- else {$data->{"itemlocationloop"}=[];}
- $data->{"branchloop"}=\@branchloop ;
- }
+ my $choice = ($itemstatusloopcount == 1) ? 1 : 0;
+ foreach my $data (@serialslist){
+ $data->{"itemstatusloop"} = (scalar(@itemstatusloop )) ? \@itemstatusloop : [];
+ $data->{"itemlocationloop"} = (scalar(@itemlocationloop)) ? \@itemlocationloop : [];
+ $data->{"branchloop"} = \@branchloop ;
+ }