X-Git-Url: http://git.rot13.org/?p=webpac2;a=blobdiff_plain;f=lib%2FWebPAC%2FOutput.pm;h=e0d4812b21a43c0d998611d01f6ea755f4181a47;hp=ee35e7d8a7074f0d8c35932cf04a493f9d6d5f2c;hb=ae1abb940214aa28ff93aab2f6120f2a78030260;hpb=3bb5a1b2498f857ed38aafeab6c0d50f82c6ed1d diff --git a/lib/WebPAC/Output.pm b/lib/WebPAC/Output.pm index ee35e7d..e0d4812 100644 --- a/lib/WebPAC/Output.pm +++ b/lib/WebPAC/Output.pm @@ -25,23 +25,28 @@ Common routines for output formats =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';