File Coverage

blib/lib/Geo/Hashing/Source/Random.pm
Criterion Covered Total %
statement 7 7 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 10 11 90.9


line stmt bran cond sub pod time code
1             #!/usr/bin/perl -w
2             #
3             # $Id: Random.pm 255 2008-06-21 03:48:46Z dan $
4             #
5              
6             package Geo::Hashing::Source::Random;
7              
8 1     1   6 use strict;
  1         3  
  1         40  
9 1     1   6 use warnings;
  1         2  
  1         128  
10             require Exporter;
11              
12             our @ISA = qw/Exporter/;
13             our @EXPORT = qw/get_djia/;
14              
15             =head1 NAME
16              
17             Geo::Hashing::Source::Random - Use random values instead of DJIA opening values
18              
19             =head1 SYNOPSIS
20              
21             use Geo::Hashing;
22             my $g = new Geo::Hashing(source => 'random');
23             printf "Today's random offset is at %.6f, %.6f.\n", $g->lat, $g->lon;
24              
25             =head1 DESCRIPTION
26              
27             See documentation of Geo::Hashing.
28              
29             =cut
30             sub get_djia {
31 3     3 0 55 return 10000 + int(100*rand(3000))/100;
32             }
33              
34             =head1 AUTHOR
35              
36             Dan Boger, Ezigdon@gmail.comE
37              
38             =head1 COPYRIGHT AND LICENSE
39              
40             Copyright (C) 2008 by Dan Boger
41              
42             This library is free software; you can redistribute it and/or modify
43             it under the same terms as Perl itself, either Perl version 5.10.0 or,
44             at your option, any later version of Perl 5 you may have available.
45              
46             =cut
47             1;