blib/lib/Ixchel/functions/product.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 CC 1 SCAR 6.9
CC
1
Cov
0%
product
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Ixchel::functions::product;
2  
3 use 5.006;
4 use strict;
5 use warnings;
6 use File::Slurp;
7 use Exporter 'import';
8 our @EXPORT = qw(product);
9  
10 =head1 NAME
11  
12 Ixchel::functions::product - Returns the product name of the system found via dmidecode.
13  
14 =head1 VERSION
15  
16 Version 0.0.1
17  
18 =cut
19  
20 our $VERSION = '0.0.1';
21  
22 =head1 SYNOPSIS
23  
24 use Ixchel::functions::product;
25  
26 print 'Product: '.product."\n";
27  
28 =head1 Functions
29  
30 =head2 product
31  
32 Fetches system-product-name via dmidecode.
33  
34 If not ran as root, this will return blank.
35  
36 =cut
37  
38 sub product {
39 my $output = `dmidecode --string=system-product-name 2> /dev/null`;
40 chomp($output);
41  
42 return $output;
43 }
44  
45 1;