projects
/
webpac2
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r1670@llin: dpavlin | 2007-11-28 00:13:29 +0100
[webpac2]
/
lib
/
WebPAC
/
Output.pm
diff --git
a/lib/WebPAC/Output.pm
b/lib/WebPAC/Output.pm
index
ee35e7d
..
e0d4812
100644
(file)
--- a/
lib/WebPAC/Output.pm
+++ b/
lib/WebPAC/Output.pm
@@
-25,23
+25,28
@@
Common routines for output formats
=head2 ds_to_hash
=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;
=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 $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';
# FIXME get rid of non hash values in data_structure for consistency?
next unless ref($ds->{$t}) eq 'HASH';