CPAN::Search::Lite::Lang - export some common data structures used by CPAN::Search::Lite::* |
CPAN::Search::Lite::Lang - export some common data structures used by CPAN::Search::Lite::*
This module can be used to populate some common data structures used by other CPAN::Search::Lite::* modules based on a requested language. The translated form of these structures are contained in CPAN::Search::Lite::Lang::*.pm (for example, en.pm or fr.pm). A hash %langs is exported, supplying a list of languages available, as well as a function load, used as
load(lang => $lang, pages => $pages, chaps_desc => $chaps_desc);
which will, for example, take the data structure $pages
and
populate $pages-
{$lang}> with the appropriate $page
from
the requested $pages
from CPAN::Search::Lite::Lang::$lang.pm
.
At present the available data structures are:
$chaps_desc
foreach my $lang(sort keys %$chaps_desc) { print "For language $lang\n"; foreach my $id(sort {$a <=> $b} keys %{$chaps_desc->{$lang}}) { print " $id => $chaps_desc->{$lang}->{$id}\n"; } }
Special characters used are HTML-encoded.
$dslip
for my $lang (sort keys %$dslip) { print "For language $lang:\n"; for my $key (qw/d s l i p/) { print " For key $key: $dslip->{$lang}->{$key}->{desc}\n"; for my $entry (sort keys %{$dslip->{$lang}->{$key}}) { next if $entry eq 'desc'; print " Entry $entry: $dslip->{$lang}->{$key}->{$entry}\n"; } } }
Special characters used are HTML-encoded.
$pages
$months
CPAN::Search::Lite::Lang - export some common data structures used by CPAN::Search::Lite::* |