File Coverage

blib/lib/Data/Phrasebook/Plain.pm
Criterion Covered Total %
statement 28 28 100.0
branch 10 12 83.3
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 45 47 95.7


line stmt bran cond sub pod time code
1             package Data::Phrasebook::Plain;
2 10     10   13764 use strict;
  10         22  
  10         408  
3 10     10   61 use warnings FATAL => 'all';
  10         21  
  10         577  
4 10     10   56 use base qw( Data::Phrasebook::Generic Data::Phrasebook::Debug );
  10         20  
  10         5248  
5 10     10   71 use Carp qw( croak );
  10         15  
  10         540  
6              
7 10     10   54 use vars qw($VERSION);
  10         17  
  10         3238  
8             $VERSION = '0.35';
9              
10             =head1 NAME
11              
12             Data::Phrasebook::Plain - The Simple Phrasebook Model.
13              
14             =head1 SYNOPSIS
15              
16             use Data::Phrasebook;
17              
18             my $q = Data::Phrasebook->new(
19             class => 'Plain',
20             loader => 'Text',
21             file => 'phrases.txt',
22             );
23              
24             my $r = Data::Phrasebook->new( file => 'phrases.txt' );
25              
26             # simple keyword to phrase mapping
27             my $phrase = $q->fetch($keyword);
28              
29             # keyword to phrase mapping with parameters
30             $q->delimiters( qr{ \[% \s* (\w+) \s* %\] }x );
31             my $phrase = $q->fetch($keyword,{this => 'that'});
32              
33             =head1 DESCRIPTION
34              
35             This module is the fallback or default phrasebook class. It doesn't do much
36             except act as a very simple templating facility.
37              
38             =head1 METHODS
39              
40             =head2 fetch
41              
42             Retrieves the specified C