| 1 | package App::PS1::Plugin::Env; | ||||||||||
| 2 | |||||||||||
| 3 | # Created on: 2011-06-21 09:48:15 | ||||||||||
| 4 | # Create by: Ivan Wills | ||||||||||
| 5 | # $Id$ | ||||||||||
| 6 | # $Revision$, $HeadURL$, $Date$ | ||||||||||
| 7 | # $Revision$, $Source$, $Date$ | ||||||||||
| 8 | |||||||||||
| 9 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 1 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 1 | ▶ | use Data::Dumper qw/Dumper/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use English qw/ -no_match_vars /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | our $VERSION = 0.08; | |||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub env { | ||||||||
|
Subroutine
env: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 18 | 0 | my ($self, $options) = @_; | |||||||||
| 19 | 0 | my $out = ''; | |||||||||
| 20 | 0 | for my $name (sort keys %$options) { | |||||||||
| 21 | 0 | ▶ | next if !$ENV{$options->{$name}}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | ▶ | $out .= ', ' if $out; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 0 | $out .= "$name: $ENV{$options->{$name}}"; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 0 | return $self->surround( | |||||||||
| 28 | length $out, | ||||||||||
| 29 | $out, | ||||||||||
| 30 | ); | ||||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 1 | 1; | |||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||