=head2 ds_to_hash
- my $hash = $self->ds_to_hash( $ds, 'display' );
+ my $hash = $self->ds_to_hash( $ds, 'display'
+ disable_key_mungle => 1,
+ );
=cut
sub ds_to_hash {
my $self = shift;
- my ( $ds, $type ) = @_;
+ my $ds = shift || confess "need ds";
+ my $type = shift || confess "need type";
- confess "need ds" unless $ds;
- confess "need type" unless $type;
+ my $opt = {@_};
my $hash;
foreach my $t ( keys %$ds ) {
- my $name = lc($t);
- $name =~ s/\W+/_/g;
+ my $name = $t;
+ if ( ! $opt->{disable_key_mungle} ) {
+ $name = lc($name);
+ $name =~ s/\W+/_/g;
+ }
# FIXME get rid of non hash values in data_structure for consistency?
next unless ref($ds->{$t}) eq 'HASH';