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 | 54 | 54 | 714 | use strict; | |||
54 | 102 | ||||||
54 | 1359 | ||||||
3 | 54 | 54 | 264 | use warnings; | |||
54 | 92 | ||||||
54 | 1523 | ||||||
4 | 54 | 54 | 261 | use Exporter qw(import); | |||
54 | 92 | ||||||
54 | 6878 | ||||||
5 | |||||||
6 | our @EXPORT_OK = qw(quote_gnuplot_str); | ||||||
7 | |||||||
8 | sub quote_gnuplot_str { | ||||||
9 | 135 | 135 | 0 | 217 | my ($str) = @_; | ||
10 | 135 | 100 | 344 | return undef if !defined($str); | |||
11 | 127 | 206 | $str = "$str"; ## explicit stringification | ||||
12 | 127 | 235 | $str =~ s/'/''/g; | ||||
13 | 127 | 656 | return qq{'$str'}; | ||||
14 | } | ||||||
15 | |||||||
16 | 1; |