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 | 55 | 55 | 643 | use strict; | |||
55 | 104 | ||||||
55 | 1427 | ||||||
3 | 55 | 55 | 260 | use warnings; | |||
55 | 100 | ||||||
55 | 1501 | ||||||
4 | 55 | 55 | 267 | use Exporter qw(import); | |||
55 | 84 | ||||||
55 | 6957 | ||||||
5 | |||||||
6 | our @EXPORT_OK = qw(quote_gnuplot_str); | ||||||
7 | |||||||
8 | sub quote_gnuplot_str { | ||||||
9 | 139 | 139 | 0 | 225 | my ($str) = @_; | ||
10 | 139 | 100 | 367 | return undef if !defined($str); | |||
11 | 131 | 206 | $str = "$str"; ## explicit stringification | ||||
12 | 131 | 234 | $str =~ s/'/''/g; | ||||
13 | 131 | 702 | return qq{'$str'}; | ||||
14 | } | ||||||
15 | |||||||
16 | 1; |