# is passed two items, # 1 - the data results in either a hash ref or array ref # 2 - the ignore list as an anonymous array or hash # # Print statements are commented for benchmarking # sub show_all_except { my ($dr,$ignore) = @_; my $output; if (ref($ignore) eq 'ARRAY') { for my $row (@{$dr}) { ROW: for my $count (0..@{$row}) { for (0..@{$ignore}) { if ($count == $_) { next ROW; } } $output .= "$row->[$count] "; } $output .= "\n"; } } elsif(ref($ignore) eq 'HASH') { for my $row (%{$dr}) { for (keys %{$dr->{$row}}) { next if $ignore->{$_}; $output .= "$_ = $dr->{$row}{$_} "; } $output .= "\n"; } } return $output; }