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! |
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 |
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. |