File Coverage

blib/lib/Env/Scalars/scalars2yaml.pm
Criterion Covered Total %
statement 11 16 68.7
branch n/a
condition 0 3 0.0
subroutine 4 5 80.0
pod 0 1 0.0
total 15 25 60.0


line stmt bran cond sub pod time code
1             #!/usr/bin/env perl
2             # Last modified: Tue Sep 02 2025 01:16:34 PM -04:00 [EDT]
3             # First created: Wed Aug 06 2025 01:25:55 PM -04:00 [EDT]
4              
5             package Env::Scalars::scalars2yaml;
6 1     1   8 use strict;
  1         4  
  1         44  
7 1     1   15 use v5.18;
  1         4  
8 1     1   8 use utf8;
  1         2  
  1         9  
9 1     1   44 use warnings;
  1         2  
  1         424  
10             our $VERSION = '0.35';
11             require Exporter;
12             our @ISA = qw(Exporter);
13             our @EXPORT = ();
14             our @EXPORT_OK = qw(s2yaml);
15              
16             =head1 SYNOPSIS
17              
18             =cut
19              
20             sub s2yaml {
21             my @accepted =
22             grep {
23 0   0 0 0   not $_ eq "PERL5LIB" and
  0            
24             not $_ eq "_" and
25             not $_ eq "!::" and
26             not $_ eq "PWD" and
27             not /^XDG_[A-Z]+_DIRS$/ and
28             not /[_A-Z0-9]*PATH$/
29             } sort keys %ENV;
30              
31 0           my @items = map { sprintf( '%s: %s' , $_ , $ENV{$_} ) }
  0            
32             @accepted;
33 0           return \@items;
34             }
35              
36             1;
37             __END__