- if ($formkey =~ /^part1_column_option_(\d+)/) {
- #download speed
- return (broadband_downstream => $min_download_speed[$1]);
- } elsif ($formkey =~ /^part1_row_option_(\d+)/) {
- #upload speed
- return (broadband_upstream => $min_upload_speed[$1]);
- } elsif ($formkey =~ /^part1_technology_option_(\d+)/) {
- #broadband tech
- return (is_broadband => 1,
- media => $media_type[$1],
- technology => $technology[$1]);
- } elsif ($formkey =~ /^part2a_row_option_(\d+)/) {
- #local phone options
- return (split(':', $phone_option[$1]));
- } elsif ($formkey =~ /^part2b_row_option_(\d+)/) {
- #VoIP options (are all media types)
- return (split(':', $voip_option[$1]));
- } else {
- warn "can't parse option with formkey '$formkey'\n";
- return;
+ my @return;
+ foreach my $formkey (@$formkeys) {
+ if ($formkey =~ /^part1_column_option_(\d+)/) {
+ #download speed
+ push @return, (broadband_downstream => $min_download_speed[$1]);
+ } elsif ($formkey =~ /^part1_row_option_(\d+)/) {
+ #upload speed
+ push @return, (broadband_upstream => $min_upload_speed[$1]);
+ } elsif ($formkey =~ /^part1_technology_option_(\d+)/) {
+ #broadband tech
+ push @return,
+ (is_broadband => 1,
+ media => $media_type[$1],
+ technology => $technology[$1]);
+ } elsif ($formkey =~ /^part2a_row_option_(\d+)/) {
+ #local phone options
+ push @return,
+ (media => 'Copper', # sensible default
+ split(':', $phone_option[$1])
+ );
+ } elsif ($formkey =~ /^part2b_row_option_(\d+)/) {
+ #VoIP options (are all media types)
+ push @return, (split(':', $voip_option[$1]));
+ } elsif ($formkey =~ /^part5_report_option/) {
+ # ignore this
+ } else {
+ warn "can't parse option with formkey '$formkey'\n";
+ }