File Coverage

blib/lib/more.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1 1     1   494 use 5.12.0;
  1         4  
  1         42  
2 1     1   5 use warnings;
  1         2  
  1         46  
3             package more;
4             # ABSTRACT: use more of a resource
5             $more::VERSION = '0.203';
6 1     1   5 use less 0.03 ();
  1         14  
  1         18  
7 1     1   5 use parent 'less';
  1         2  
  1         6  
8              
9             1;
10              
11             =pod
12              
13             =encoding UTF-8
14              
15             =head1 NAME
16              
17             more - use more of a resource
18              
19             =head1 VERSION
20              
21             version 0.203
22              
23             =head1 SYNOPSIS
24              
25             use more 'variables';
26              
27             =head1 DESCRIPTION
28              
29             As of perl5 version 10, the long-useless pragma L became a usable tool
30             for indicating that less I could be used. For example, the user
31             could specify that less memory should be used, and other libraries could then
32             choose between multiple algorithms based on that choice.
33              
34             In the user's program:
35              
36             use less 'memory';
37              
38             my $result = Analyzer->analyze( $large_data_set );
39              
40             In the library:
41              
42             sub analyze {
43             my ($self, $data) = @_;
44              
45             my $cache = less->of('memory') ? 'disk' : 'ram';
46             my $method = "analyze_with_${cache}_cache";
47              
48             return $self->$method($data);
49             }
50              
51             This allowed for an explosion of highly adaptive implementions, accounting for
52             a complex matrix of "less" interactions. Unfortunately, there is no mechanism
53             for requesting that I of something be used, to help do our part as good
54             consumers. The often-heard advice to simply write C<< no less 'spending' >> is
55             insufficient. That only means we should maintain our current levels. We want
56             to request an increase.
57              
58             This library corrects this deficiency by allowing the user to write:
59              
60             use more 'spending';
61              
62             =head1 AUTHOR
63              
64             Ricardo SIGNES
65              
66             =head1 COPYRIGHT AND LICENSE
67              
68             This software is copyright (c) 2014 by Ricardo SIGNES.
69              
70             This is free software; you can redistribute it and/or modify it under
71             the same terms as the Perl 5 programming language system itself.
72              
73             =cut
74              
75             __END__