/[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 912 by dpavlin, Sun Jul 17 10:42:23 2005 UTC revision 913 by dpavlin, Tue Oct 30 20:11:02 2007 UTC
# Line 3  package WebPAC::Output; Line 3  package WebPAC::Output;
3  use warnings;  use warnings;
4  use strict;  use strict;
5    
6    use Carp qw/confess/;
7    
8  =head1 NAME  =head1 NAME
9    
10  WebPAC::Output - The great new WebPAC::Output!  WebPAC::Output - The great new WebPAC::Output!
# Line 17  our $VERSION = '0.01'; Line 19  our $VERSION = '0.01';
19    
20  =head1 SYNOPSIS  =head1 SYNOPSIS
21    
22  Quick summary of what the module does.  Common routines for output formats
23    
24  Perhaps a little code snippet.  =head1 FUNCTIONS
25    
26      use WebPAC::Output;  =head2 ds_to_hash
27    
28      my $foo = WebPAC::Output->new();    my $hash = $self->ds_to_hash( $ds, 'display' );
     ...  
29    
30  =head1 EXPORT  =cut
31    
32  A list of functions that can be exported.  You can delete this section  sub ds_to_hash {
33  if you don't export anything, such as for a purely object-oriented module.          my $self = shift;
34    
35  =head1 FUNCTIONS          my ( $ds, $type ) = @_;
36    
37  =head2 function1          confess "need ds" unless $ds;
38            confess "need type" unless $type;
39    
40  =cut          my $hash;
41    
42  sub function1 {          foreach my $t ( keys %$ds ) {
43  }                  my $name = lc($t);
44                    $name =~ s/\W+/_/g;
45    
46  =head2 function2                  # FIXME get rid of non hash values in data_structure for consistency?
47                    next unless ref($ds->{$t}) eq 'HASH';
48    
49  =cut                  if ( defined( $ds->{$t}->{$type} ) ) {
50                            $hash->{$name} = $ds->{$t}->{$type};
51                    }
52            }
53    
54  sub function2 {          return $hash;
55  }  }
56    
57  =head1 AUTHOR  =head1 AUTHOR
# Line 53  Dobrica Pavlinusic, C<< <dpavlin@rot13.o Line 60  Dobrica Pavlinusic, C<< <dpavlin@rot13.o
60    
61  =head1 COPYRIGHT & LICENSE  =head1 COPYRIGHT & LICENSE
62    
63  Copyright 2005 Dobrica Pavlinusic, All Rights Reserved.  Copyright 2005-2007 Dobrica Pavlinusic, All Rights Reserved.
64    
65  This program is free software; you can redistribute it and/or modify it  This program is free software; you can redistribute it and/or modify it
66  under the same terms as Perl itself.  under the same terms as Perl itself.

Legend:
Removed from v.912  
changed lines
  Added in v.913

  ViewVC Help
Powered by ViewVC 1.1.26