/[webpac2]/trunk/lib/WebPAC/Output.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/WebPAC/Output.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 924 by dpavlin, Wed Oct 31 00:26:45 2007 UTC revision 1068 by dpavlin, Tue Nov 27 23:45:28 2007 UTC
# Line 25  Common routines for output formats Line 25  Common routines for output formats
25    
26  =head2 ds_to_hash  =head2 ds_to_hash
27    
28    my $hash = $self->ds_to_hash( $ds, 'display' );    my $hash = $self->ds_to_hash( $ds, 'display'
29            disable_key_mungle => 1,
30      );
31    
32  =cut  =cut
33    
34  sub ds_to_hash {  sub ds_to_hash {
35          my $self = shift;          my $self = shift;
36    
37          my ( $ds, $type ) = @_;          my $ds = shift || confess "need ds";
38            my $type = shift || confess "need type";
39    
40          confess "need ds" unless $ds;          my $opt = {@_};
         confess "need type" unless $type;  
41    
42          my $hash;          my $hash;
43    
44          foreach my $t ( keys %$ds ) {          foreach my $t ( keys %$ds ) {
45                  my $name = lc($t);                  my $name = $t;
46                  $name =~ s/\W+/_/g;                  if ( ! $opt->{disable_key_mungle} ) {
47                            $name = lc($name);
48                            $name =~ s/\W+/_/g;
49                    }
50    
51                  # FIXME get rid of non hash values in data_structure for consistency?                  # FIXME get rid of non hash values in data_structure for consistency?
52                  next unless ref($ds->{$t}) eq 'HASH';                  next unless ref($ds->{$t}) eq 'HASH';

Legend:
Removed from v.924  
changed lines
  Added in v.1068

  ViewVC Help
Powered by ViewVC 1.1.26