| 1 | # | ||||||||||
| 2 | # Copyright (c) 2004-2020 Christian Jaeger, copying@christianjaeger.ch | ||||||||||
| 3 | # | ||||||||||
| 4 | # This is free software, offered under either the same terms as perl 5 | ||||||||||
| 5 | # or the terms of the Artistic License version 2 or the terms of the | ||||||||||
| 6 | # MIT License (Expat version). See the file COPYING.md that came | ||||||||||
| 7 | # bundled with this file. | ||||||||||
| 8 | # | ||||||||||
| 9 | |||||||||||
| 10 | =head1 NAME | ||||||||||
| 11 | |||||||||||
| 12 | Chj::chompspace | ||||||||||
| 13 | |||||||||||
| 14 | =head1 SYNOPSIS | ||||||||||
| 15 | |||||||||||
| 16 | =head1 DESCRIPTION | ||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | =head1 NOTE | ||||||||||
| 20 | |||||||||||
| 21 | This is alpha software! Read the status section in the package README | ||||||||||
| 22 | or on the L<website|http://functional-perl.org/>. | ||||||||||
| 23 | |||||||||||
| 24 | =cut | ||||||||||
| 25 | |||||||||||
| 26 | package Chj::chompspace; | ||||||||||
| 27 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 28 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | 4 | ▶ | use warnings FATAL => 'uninitialized'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 30 | 4 | ▶ | use Exporter "import"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 31 | |||||||||||
| 32 | 4 | our @EXPORT = qw(chompspace); | |||||||||
| 33 | |||||||||||
| 34 | #@EXPORT_OK = qw(); | ||||||||||
| 35 | |||||||||||
| 36 | 4 | ▶ | use FP::Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 37 | |||||||||||
| 38 | 8 | ▶ | sub chompspace { | ||||||||
|
Subroutine
chompspace: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 39 | 8 | ▶ | @_ == 1 or fp_croak_arity 1; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 8 | my ($str) = @_; | |||||||||
| 41 | 8 | $str =~ s/^\s+//s; | |||||||||
| 42 | 8 | $str =~ s/\s+\z//s; | |||||||||
| 43 | 8 | $str | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 4 | *Chj::chompspace = \&chompspace; | |||||||||
| 47 | |||||||||||
| 48 | 4 | 1; | |||||||||