File Coverage

blib/lib/String/Util.pm
Criterion Covered Total %
statement 149 182 81.8
branch 49 66 74.2
condition 23 35 65.7
subroutine 26 30 86.6
pod 22 23 95.6
total 269 336 80.0


line stmt bran cond sub pod time code
1             package String::Util;
2              
3 2     2   10050 use strict;
  2         4  
  2         65  
4 2     2   21 use warnings;
  2         3  
  2         71  
5 2     2   9 use Carp;
  2         2  
  2         224  
6 2     2   56 use v5.14;
  2         8  
7              
8             # version
9             # https://blogs.perl.org/users/grinnz/2018/04/a-guide-to-versions-in-perl.html
10             # https://github.com/andk/pause/blob/master/doc/operating-model.md#36-developer-releases
11             our $VERSION = '1.35';
12             our $FGC_MODE = 'UTF-8';
13              
14             #------------------------------------------------------------------------------
15             # opening POD
16             #
17              
18             =head1 NAME
19              
20             B<String::Util> -- String processing utility functions
21              
22             =head1 DESCRIPTION
23              
24             B<String::Util> provides a collection of small, handy functions for processing
25             strings in various ways.
26              
27             =head1 INSTALLATION
28              
29             cpanm String::Util
30              
31             =head1 USAGE
32              
33             No functions are exported by default, they must be specified:
34              
35             use String::Util qw(trim eqq contains)
36              
37             alternately you can use C<:all> to export B<all> of the functions
38              
39             use String::Util qw(:all)
40              
41             =head1 FUNCTIONS
42              
43             =cut
44              
45             #
46             # opening POD
47             #------------------------------------------------------------------------------
48              
49              
50              
51             #------------------------------------------------------------------------------
52             # export
53             #
54 2     2   12 use base 'Exporter';
  2         3  
  2         314  
55 2     2   12 use vars qw[@EXPORT_OK %EXPORT_TAGS];
  2         3  
  2         5157  
56              
57             # the following functions accept a value and return a modified version of
58             # that value
59             push @EXPORT_OK, qw[
60             collapse htmlesc trim ltrim
61             rtrim repeat unquote no_space
62             nospace jsquote crunchlines
63             file_get_contents substr_count
64             ];
65              
66             # the following functions return true or false based on their input
67             push @EXPORT_OK, qw[
68             hascontent nocontent eqq neqq
69             startswith endswith contains sanitize
70             ];
71              
72             # the following function returns the unicode values of a string
73             push @EXPORT_OK, qw[ ords deords ];
74              
75             %EXPORT_TAGS = ('all' => [@EXPORT_OK]);
76             #
77             # export
78             #------------------------------------------------------------------------------
79              
80              
81             #------------------------------------------------------------------------------
82             # collapse
83             #
84              
85             =head2 collapse($string)
86              
87             C<collapse()> collapses all whitespace in the string down to single spaces.
88             Also removes all leading and trailing whitespace. Undefined input results in
89             undefined output.
90              
91             $var = collapse(" Hello world! "); # "Hello world!"
92              
93             =cut
94              
95             sub collapse {
96 2     2 1 311309 my ($val) = @_;
97              
98 2 100       9 if (defined $val) {
99 1         7 $val =~ s|^\s+||s;
100 1         7 $val =~ s|\s+$||s;
101 1         6 $val =~ s|\s+| |sg;
102             }
103              
104 2         16 return $val;
105             }
106              
107             #
108             # collapse
109             #------------------------------------------------------------------------------
110              
111              
112             #------------------------------------------------------------------------------
113             # hascontent
114             #
115              
116             =head2 hascontent($scalar), nocontent($scalar)
117              
118             C<hascontent()> returns true if the given argument is defined and contains
119             something besides whitespace.
120              
121             An undefined value returns false. An empty string returns false. A value
122             containing nothing but whitespace (spaces, tabs, carriage returns, newlines,
123             backspace) returns false. A string containing any other characters (including
124             zero) returns true.
125              
126             C<nocontent()> returns the negation of C<hascontent()>.
127              
128             $var = hascontent(""); # False
129             $var = hascontent(" "); # False
130             $var = hascontent("a"); # True
131              
132             $var = nocontent(""); # True
133             $var = nocontent("a"); # False
134              
135             =cut
136              
137             sub hascontent {
138 11     11 1 22 my $val = shift();
139              
140 11 100       35 if (!defined($val)) {
141 2         14 return 0;
142             }
143              
144             # If there are ANY non-space characters in it
145 9 100       38 if ($val =~ m|\S|s) {
146 5         17 return 1;
147             }
148              
149 4         24 return 0;
150             }
151              
152             sub nocontent {
153 6     6 1 15 my $str = shift();
154              
155             # nocontent() is just the inverse to hascontent()
156 6         13 my $ret = !(hascontent($str));
157              
158 6         27 return $ret;
159             }
160              
161             #
162             # hascontent
163             #------------------------------------------------------------------------------
164              
165              
166             #------------------------------------------------------------------------------
167             # trim
168             #
169              
170             =head2 trim($string), ltrim($string), rtrim($string)
171              
172             Returns the string with all leading and trailing whitespace removed.
173              
174             $var = trim(" my string "); # "my string"
175              
176             C<ltrim()> trims B<leading> whitespace only.
177              
178             C<rtrim()> trims B<trailing> whitespace only.
179              
180             =cut
181              
182             sub trim {
183 5     5 1 14 my $s = shift();
184              
185 5 100       18 if (!defined($s)) {
186 1         5 return undef;
187             }
188              
189 4         24 $s =~ s/^\s*//u;
190 4         22 $s =~ s/\s*$//u;
191              
192 4         20 return $s;
193             }
194             #
195             # trim
196             #------------------------------------------------------------------------------
197              
198              
199             #------------------------------------------------------------------------------
200             # ltrim, rtrim
201             #
202              
203             sub ltrim {
204 2     2 1 6 my $s = shift();
205              
206 2 100       8 if (!defined($s)) {
207 1         5 return undef;
208             }
209              
210 1         6 $s =~ s/^\s*//u;
211              
212 1         5 return $s;
213             }
214              
215             sub rtrim {
216 2     2 1 4 my $s = shift();
217              
218 2 100       8 if (!defined($s)) {
219 1         33 return undef;
220             }
221              
222 1         9 $s =~ s/\s*$//u;
223              
224 1         5 return $s;
225             }
226              
227             #
228             # ltrim, rtrim
229             #------------------------------------------------------------------------------
230              
231              
232              
233             #------------------------------------------------------------------------------
234             # no_space
235             #
236              
237             =head2 nospace($string)
238              
239             Removes B<all> whitespace characters from the given string. This includes spaces
240             between words.
241              
242             $var = nospace(" Hello World! "); # "HelloWorld!"
243              
244             =cut
245              
246             sub no_space {
247 0     0 0 0 return nospace(@_);
248             }
249              
250             # alias nospace to no_space
251             sub nospace {
252 3     3 1 9 my $val = shift();
253              
254 3 100       10 if (defined $val) {
255 2         12 $val =~ s|\s+||gs;
256             }
257              
258 3         14 return $val;
259             }
260              
261             #
262             # no_space
263             #------------------------------------------------------------------------------
264              
265              
266              
267             #------------------------------------------------------------------------------
268             # htmlesc
269             #
270              
271             =head2 htmlesc($string)
272              
273             Formats a string for literal output in HTML. An undefined value is returned as
274             an empty string.
275              
276             htmlesc() is very similar to CGI.pm's escapeHTML. However, there are a few
277             differences. htmlesc() changes an undefined value to an empty string, whereas
278             escapeHTML() returns undefs as undefs.
279              
280             =cut
281              
282             sub htmlesc {
283 2     2 1 7 my ($val) = @_;
284              
285 2 100       32 if (defined $val) {
286 1         7 $val =~ s|\&|&amp;|g;
287 1         4 $val =~ s|\"|&quot;|g;
288 1         4 $val =~ s|\<|&lt;|g;
289 1         4 $val =~ s|\>|&gt;|g;
290             } else {
291 1         2 $val = '';
292             }
293              
294 2         10 return $val;
295             }
296             #
297             # htmlesc
298             #------------------------------------------------------------------------------
299              
300              
301             #------------------------------------------------------------------------------
302             # jsquote
303             #
304              
305             =head2 jsquote($string)
306              
307             Escapes and quotes a string for use in JavaScript. Escapes single quotes and
308             surrounds the string in single quotes. Returns the modified string.
309              
310             =cut
311              
312             sub jsquote {
313 1     1 1 5 my ($str) = @_;
314              
315 1 50       4 if (!defined($str)) {
316 0         0 return undef;
317             }
318              
319             # Escape single quotes.
320 1         7 $str =~ s|'|\\'|gs;
321              
322             # Break up anything that looks like a closing HTML tag. This modification
323             # is necessary in an HTML web page. It is unnecessary but harmless if the
324             # output is used in a JavaScript document.
325 1         4 $str =~ s|</|<' + '/|gs;
326              
327             # break up newlines
328 1         4 $str =~ s|\n|\\n|gs;
329              
330             # surround in quotes
331 1         3 $str = qq|'$str'|;
332              
333             # return
334 1         5 return $str;
335             }
336             #
337             # jsquote
338             #------------------------------------------------------------------------------
339              
340              
341             #------------------------------------------------------------------------------
342             # unquote
343             #
344              
345             =head2 unquote($string)
346              
347             If the given string starts and ends with quotes, removes them. Recognizes
348             single quotes and double quotes. The value must begin and end with same type
349             of quotes or nothing is done to the value. Undef input results in undef output.
350             Some examples and what they return:
351              
352             unquote(q|'Hendrix'|); # Hendrix
353             unquote(q|"Hendrix"|); # Hendrix
354             unquote(q|Hendrix|); # Hendrix
355             unquote(q|"Hendrix'|); # "Hendrix'
356             unquote(q|O'Sullivan|); # O'Sullivan
357              
358             B<option:> braces
359              
360             If the braces option is true, surrounding braces such as [] and {} are also
361             removed. Some examples:
362              
363             unquote(q|[Janis]|, braces=>1); # Janis
364             unquote(q|{Janis}|, braces=>1); # Janis
365             unquote(q|(Janis)|, braces=>1); # Janis
366              
367             =cut
368              
369             sub unquote {
370 4     4 1 12 my ($val, %opts) = @_;
371              
372 4 50       14 if (defined $val) {
373 4 100 66     44 my $found = $val =~ s|^\`(.*)\`$|$1|s or
374             $val =~ s|^\"(.*)\"$|$1|s or
375             $val =~ s|^\'(.*)\'$|$1|s;
376              
377 4 50 33     15 if ($opts{'braces'} && ! $found) {
378 0 0 0     0 $val =~ s|^\[(.*)\]$|$1|s or
379             $val =~ s|^\((.*)\)$|$1|s or
380             $val =~ s|^\{(.*)\}$|$1|s;
381             }
382             }
383              
384 4         22 return $val;
385             }
386             #
387             # unquote
388             #------------------------------------------------------------------------------
389              
390              
391             #------------------------------------------------------------------------------
392             # repeat
393             #
394              
395             =head2 repeat($string, $count)
396              
397             Returns the given string repeated the given number of times. The following
398             command outputs "Fred" three times:
399              
400             print repeat('Fred', 3), "\n";
401              
402             Note that C<repeat()> was created a long time based on a misunderstanding of how
403             the perl operator 'x' works. The following command using C<x> would perform
404             exactly the same as the above command.
405              
406             print 'Fred' x 3, "\n";
407              
408             Use whichever you prefer.
409              
410             =cut
411              
412             sub repeat {
413 0     0 1 0 my ($val, $count) = @_;
414 0         0 return ($val x int($count));
415             }
416             #
417             # repeat
418             #------------------------------------------------------------------------------
419              
420              
421             #------------------------------------------------------------------------------
422             # eqq
423             # formerly equndef
424             #
425              
426             =head2 eqq($scalar1, $scalar2)
427              
428             Returns true if the two given values are equal. Also returns true if both
429             are C<undef>. If only one is C<undef>, or if they are both defined but different,
430             returns false. Here are some examples and what they return.
431              
432             $var = eqq('x', 'x'); # True
433             $var = eqq('x', undef); # False
434             $var = eqq(undef, undef); # True
435              
436             =cut
437              
438             sub eqq {
439 8     8 1 23 my ($str1, $str2) = @_;
440              
441             # if both defined
442 8 100 100     42 if ( defined($str1) && defined($str2) ) {
443 4         22 return $str1 eq $str2
444             }
445              
446             # if neither are defined
447 4 50 66     20 if ( (!defined($str1)) && (!defined($str2)) ) {
448 2         11 return 1
449             }
450              
451             # only one is defined, so return false
452 2         10 return 0;
453             }
454             #
455             # eqq
456             #------------------------------------------------------------------------------
457              
458              
459             #------------------------------------------------------------------------------
460             # neqq
461             # formerly neundef
462             #
463              
464             =head2 neqq($scalar1, $scalar2)
465              
466             The opposite of C<neqq>, returns true if the two values are *not* the same.
467             Here are some examples and what they return.
468              
469             $var = neqq('x', 'x'); # False
470             $var = neqq('x', undef); # True
471             $var = neqq(undef, undef); # False
472              
473             =cut
474              
475             sub neqq {
476 4 100   4 1 12 return eqq(@_) ? 0 : 1;
477             }
478             #
479             # neqq
480             #------------------------------------------------------------------------------
481              
482              
483             #------------------------------------------------------------------------------
484             # ords
485             #
486              
487             =head2 ords($string)
488              
489             Returns the given string represented as the ascii value of each character.
490              
491             $var = ords('Hendrix'); # {72}{101}{110}{100}{114}{105}{120}
492              
493             B<options>
494              
495             =over 4
496              
497             =item * convert_spaces=>[true|false]
498              
499             If convert_spaces is true (which is the default) then spaces are converted to
500             their matching ord values. So, for example, this code:
501              
502             $var = ords('a b', convert_spaces=>1); # {97}{32}{98}
503              
504             This code returns the same thing:
505              
506             $var = ords('a b'); # {97}{32}{98}
507              
508             If convert_spaces is false, then spaces are just returned as spaces. So this
509             code:
510              
511             ords('a b', convert_spaces=>0); # {97} {98}
512              
513              
514             =item * alpha_nums
515              
516             If the alpha_nums option is false, then characters 0-9, a-z, and A-Z are not
517             converted. For example, this code:
518              
519             $var = ords('a=b', alpha_nums=>0); # a{61}b
520              
521             =back
522              
523             =cut
524              
525             sub ords {
526 0     0 1 0 my ($str, %opts) = @_;
527 0         0 my (@rv, $show_chars);
528              
529             # default options
530 0         0 %opts = (convert_spaces=>1, alpha_nums=>1, %opts);
531              
532             # get $show_chars option
533 0         0 $show_chars = $opts{'show_chars'};
534              
535             # split into individual characters
536 0         0 @rv = split '', $str;
537              
538             # change elements to their unicode numbers
539             CHAR_LOOP:
540 0         0 foreach my $char (@rv) {
541             # don't convert space if called so
542 0 0 0     0 if ( (! $opts{'convert_spaces'}) && ($char =~ m|^\s$|s) )
543 0         0 { next CHAR_LOOP }
544              
545             # don't convert alphanums
546 0 0       0 if (! $opts{'alpha_nums'}) {
547 0 0       0 if ( $char =~ m|^[a-z0-9]$|si) {
548 0         0 next CHAR_LOOP;
549             }
550             }
551              
552 0         0 my $rv = '{';
553              
554 0 0       0 if ($show_chars)
555 0         0 { $rv .= $char . ':' }
556              
557 0         0 $rv .= ord($char) . '}';
558              
559 0         0 $char = $rv;
560             }
561              
562             # return words separated by spaces
563 0         0 return join('', @rv);
564             }
565             #
566             # ords
567             #------------------------------------------------------------------------------
568              
569              
570             #------------------------------------------------------------------------------
571             # deords
572             #
573              
574             =head2 deords($string)
575              
576             Takes the output from C<ords()> and returns the string that original created that
577             output.
578              
579             $var = deords('{72}{101}{110}{100}{114}{105}{120}'); # 'Hendrix'
580              
581             =cut
582              
583             sub deords {
584 0     0 1 0 my ($str) = @_;
585 0         0 my (@tokens, $rv);
586 0         0 $rv = '';
587              
588             # get tokens
589 0         0 @tokens = split(m|[\{\}]|s, $str);
590 0         0 @tokens = grep {length($_)} @tokens;
  0         0  
591              
592             # build return string
593 0         0 foreach my $token (@tokens) {
594 0         0 $rv .= chr($token);
595             }
596              
597             # return
598 0         0 return $rv;
599             }
600             #
601             # deords
602             #------------------------------------------------------------------------------
603              
604             =head2 contains($string, $substring)
605              
606             Checks if the string contains substring
607              
608             $var = contains("Hello world", "Hello"); # true
609             $var = contains("Hello world", "llo wor"); # true
610             $var = contains("Hello world", ""); # true
611             $var = contains("Hello world", "QQQ"); # false
612             $var = contains(undef, "QQQ"); # false
613             $var = contains("Hello world", undef); # false
614              
615             # Also works with grep
616             @arr = grep { contains("cat") } @input;
617              
618             =cut
619              
620             sub contains {
621 12     12 1 452 my ($str, $substr) = @_;
622              
623             # If we don't see a substr we operate on $_ grep/map style
624 12 100       42 if (scalar(@_) == 1) {
625 1         3 $substr = $str;
626 1         2 $str = $_;
627             }
628              
629 12 100 100     55 if (!defined($str) || !defined($substr)) {
630 5         29 return undef;
631             }
632              
633 7         21 my $ret = index($str, $substr, 0) != -1;
634              
635 7         32 return $ret;
636             }
637              
638             =head2 startswith($string, $substring)
639              
640             Checks if the string starts with the characters in substring
641              
642             $var = startwith("Hello world", "Hello"); # true
643             $var = startwith("Hello world", "H"); # true
644             $var = startwith("Hello world", ""); # true
645             $var = startwith("Hello world", "Q"); # false
646             $var = startwith(undef, "Q"); # false
647             $var = startwith("Hello world", undef); # false
648              
649             # Also works with grep
650             @arr = grep { startswith("X") } @input;
651              
652             =cut
653              
654             sub startswith {
655 12     12 1 319391 my ($str, $substr) = @_;
656              
657             # If we don't see a substr we operate on $_ grep/map style
658 12 100       64 if (scalar(@_) == 1) {
659 1         3 $substr = $str;
660 1         3 $str = $_;
661             }
662              
663 12 100 100     63 if (!defined($str) || !defined($substr)) {
664 5         30 return undef;
665             }
666              
667 7         19 my $ret = index($str, $substr, 0) == 0;
668              
669 7         36 return $ret;
670             }
671              
672             =head2 endswith($string, $substring)
673              
674             Checks if the string ends with the characters in substring
675              
676             $var = endswith("Hello world", "world"); # true
677             $var = endswith("Hello world", "d"); # true
678             $var = endswith("Hello world", ""); # true
679             $var = endswith("Hello world", "QQQ"); # false
680             $var = endswith(undef, "QQQ"); # false
681             $var = endswith("Hello world", undef); # false
682              
683             # Also works with grep
684             @arr = grep { endswith("z") } @input;
685              
686             =cut
687              
688             sub endswith {
689 12     12 1 420 my ($str, $substr) = @_;
690              
691             # If we don't see a substr we operate on $_ grep/map style
692 12 100       43 if (scalar(@_) == 1) {
693 1         3 $substr = $str;
694 1         9 $str = $_;
695             }
696              
697 12 100 100     62 if (!defined($str) || !defined($substr)) {
698 5         29 return undef;
699             }
700              
701 7         14 my $len = length($substr);
702 7         14 my $start = length($str) - $len;
703              
704 7         20 my $ret = index($str, $substr, $start) != -1;
705              
706 7         52 return $ret;
707             }
708              
709             #------------------------------------------------------------------------------
710             # crunchlines
711             #
712              
713             =head2 crunchlines($string)
714              
715             Compacts contiguous newlines into single newlines. Whitespace between newlines
716             is ignored, so that two newlines separated by whitespace is compacted down to a
717             single newline.
718              
719             $var = crunchlines("x\n\n\nx"); # "x\nx";
720              
721             =cut
722              
723             sub crunchlines {
724 3     3 1 9 my ($str) = @_;
725              
726 3 100       11 if (!defined($str)) {
727 1         6 return undef;
728             }
729              
730 2         19 while($str =~ s|\n[ \t]*\n|\n|gs)
731             {}
732              
733 2         5 $str =~ s|^\n||s;
734 2         5 $str =~ s|\n$||s;
735              
736 2         9 return $str;
737             }
738             #
739             # crunchlines
740             #------------------------------------------------------------------------------
741              
742             =head2 sanitize($string, $separator = "_")
743              
744             Sanitize all non alpha-numeric characters in a string to underscores.
745             This is useful to take a URL, or filename, or text description and know
746             you can use it safely in a URL or a filename.
747              
748             B<Note:> This will remove any trailing or leading '_' on the string
749              
750             $var = sanitize("http://www.google.com/") # http_www_google_com
751             $var = sanitize("foo_bar()"; # foo_bar
752             $var = sanitize("/path/to/file.txt"); # path_to_file_txt
753             $var = sanitize("Big yellow bird!", "."); # Big.yellow.bird
754              
755             =cut
756              
757             sub sanitize {
758 4     4 1 11 my $str = shift();
759 4   100     21 my $sep = shift() // "_";
760              
761 4 50       11 if (!defined($str)) {
762 0         0 return undef;
763             }
764              
765             # Convert multiple non-word sequences to the separator
766 4         35 $str =~ s/[\W_]+/$sep/g;
767              
768             # The separator is a literal character so we quotemeta it
769 4         9 $sep = quotemeta($sep);
770             # Remove any separators at the beginning and end
771 4         55 $str =~ s/\A$sep+//;
772 4         73 $str =~ s/$sep+\z//;
773              
774 4         23 return $str;
775             }
776              
777             ###########################################################################
778              
779             =head2 file_get_contents($string, $boolean)
780              
781             Read an entire file from disk into a string. Returns undef if the file
782             cannot be read for any reason. Can also return the file as an array of
783             lines.
784              
785             $str = file_get_contents("/tmp/file.txt"); # Return a string
786             @lines = file_get_contents("/tmp/file.txt", 1); # Return an array
787              
788             B<Note:> If you opt to return an array, carriage returns and line feeds are
789             removed from the end of each line.
790              
791             B<Note:> File is read in B<UTF-8> mode, unless C<$FGC_MODE> is set to an
792             appropriate encoding.
793              
794             =cut
795              
796             sub file_get_contents {
797 2     2 1 10 my ($file, $ret_array) = @_;
798              
799 2 50       124 open (my $fh, "<", $file) or return undef;
800 2     1   49 binmode($fh, ":encoding($FGC_MODE)");
  1         966  
  1         18  
  1         6  
801              
802 2 100       1469 if ($ret_array) {
803 1         3 my @ret;
804              
805 1         22 while (my $line = readline($fh)) {
806 193         2385 $line =~ s/[\r\n]*$//; # Remove CR/LF
807 193         785 push(@ret, $line);
808             }
809              
810 1         88 return @ret;
811             } else {
812 1         3 my $ret = '';
813 1         31 while (my $line = readline($fh)) {
814 193         603 $ret .= $line;
815             }
816              
817 1         35 return $ret;
818             }
819             }
820              
821             #########################################################################
822              
823             =head2 substr_count($haystack, $needle)
824              
825             Count the occurences of a substr inside of a larger string. Returns
826             an integer value with the number of matches, or C<undef> if the input
827             is invalid.
828              
829             my $cnt = substr_count("Perl is really rad", "r"); # 3
830             my $num = substr_count("Perl is really rad", "Q"); # 0
831              
832             =cut
833              
834             sub substr_count {
835 7     7 1 872 my ($haystack, $needle) = @_;
836              
837 7 100 100     41 if (!defined($needle) || !defined($haystack)) { return undef; }
  2         9  
838 5 50 33     25 if ($haystack eq '' || $needle eq '') { return 0; }
  0         0  
839              
840 5         8 my $pos = 0;
841 5         10 my $matches = 0;
842              
843 5         7 while (1) {
844 10         23 $pos = index($haystack, $needle, $pos);
845              
846 10 100       22 if ($pos < 0) {
847 5         11 last;
848             }
849              
850 5         9 $matches++;
851 5         9 $pos++;
852             }
853              
854 5         25 return $matches;
855             }
856              
857              
858             # return true
859             1;
860              
861              
862             __END__
863              
864             =head1 COPYRIGHT AND LICENSE
865              
866             Copyright (c) 2012-2016 by Miko O'Sullivan. All rights reserved. This program
867             is free software; you can redistribute it and/or modify it under the same terms
868             as Perl itself. This software comes with B<NO WARRANTY> of any kind.
869              
870             =head1 AUTHORS
871              
872             Miko O'Sullivan <miko@idocs.com>
873              
874             Scott Baker <scott@perturb.org>
875              
876             =cut
877              
878              
879              
880             #------------------------------------------------------------------------------
881             # module info
882             # This info is used by a home-grown CPAN builder. Please leave it as it is.
883             #
884             {
885             // include in CPAN distribution
886             include : 1,
887              
888             // test scripts
889             test_scripts : {
890             'Util/tests/test.pl' : 1,
891             },
892             }
893             #
894             # module info
895             #------------------------------------------------------------------------------