blib/lib/Gnuplot/Builder/Util.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 14 | 14 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 20 | 21 | 95.2 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Gnuplot::Builder::Util; | ||||||
2 | 57 | 57 | 686 | use strict; | |||
57 | 110 | ||||||
57 | 1445 | ||||||
3 | 57 | 57 | 297 | use warnings; | |||
57 | 97 | ||||||
57 | 1545 | ||||||
4 | 57 | 57 | 296 | use Exporter qw(import); | |||
57 | 90 | ||||||
57 | 7386 | ||||||
5 | |||||||
6 | our @EXPORT_OK = qw(quote_gnuplot_str); | ||||||
7 | |||||||
8 | sub quote_gnuplot_str { | ||||||
9 | 139 | 139 | 0 | 224 | my ($str) = @_; | ||
10 | 139 | 100 | 426 | return undef if !defined($str); | |||
11 | 131 | 230 | $str = "$str"; ## explicit stringification | ||||
12 | 131 | 245 | $str =~ s/'/''/g; | ||||
13 | 131 | 700 | return qq{'$str'}; | ||||
14 | } | ||||||
15 | |||||||
16 | 1; |