1 package WebPAC::Output;
7 use Data::Dump qw/dump/;
11 WebPAC::Output - The great new WebPAC::Output!
17 Common routines for output formats
23 my $hash = $self->ds_to_hash( $ds, 'display'
24 disable_key_mungle => 0,
33 my $ds = shift || confess "need ds";
34 my $type = shift || confess "need type";
40 foreach my $t ( keys %$ds ) {
42 if ( ! $opt->{disable_key_mungle} ) {
47 my $v = $ds->{$t} || die "bug";
49 # FIXME get rid of non hash values in data_structure for consistency?
50 next unless ref($v) eq 'HASH';
52 if ( defined( $v->{$type} ) ) {
53 if ( $opt->{single_values} && ref($v->{$type}) eq 'ARRAY' ) {
54 $hash->{$name} = join(' ', map {
62 $hash->{$name} = $v->{$type};
73 Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>
75 =head1 COPYRIGHT & LICENSE
77 Copyright 2005-2007 Dobrica Pavlinusic, All Rights Reserved.
79 This program is free software; you can redistribute it and/or modify it
80 under the same terms as Perl itself.
84 1; # End of WebPAC::Output