| 1 | package Data::Sah::Coerce::perl::To_str::From_str::rtrim; | ||
| 2 | |||
| 3 | 2 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 4 | 2 | our $DATE = '2020-02-11'; # DATE | |
| 5 | 2 | our $DIST = 'Data-Sah-Coerce-perl-To_str-From_str-trim'; # DIST | |
| 6 | 2 | our $VERSION = '0.007'; # VERSION | |
| 7 | |||
| 8 | 2 | ▶ | use 5.010001; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 1 | ▶ | sub meta { |
|
Subroutine
meta: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 13 | +{ | ||
| 14 | 1 | v => 4, | |
| 15 | summary => '(DEPRECATED) Trim whitespaces at the end of string', | ||
| 16 | prio => 50, | ||
| 17 | }; | ||
| 18 | } | ||
| 19 | |||
| 20 | 1 | ▶ | sub coerce { |
|
Subroutine
coerce: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 21 | 1 | my %args = @_; | |
| 22 | |||
| 23 | 1 | my $dt = $args{data_term}; | |
| 24 | |||
| 25 | 1 | my $res = {}; | |
| 26 | |||
| 27 | 1 | $res->{expr_match} = "!ref($dt)"; | |
| 28 | 1 | $res->{expr_coerce} = join( | |
| 29 | "", | ||
| 30 | "do { my \$res = $dt; \$res =~ s/\\s+\\z//s; \$res }", | ||
| 31 | ); | ||
| 32 | |||
| 33 | 1 | $res; | |
| 34 | } | ||
| 35 | |||
| 36 | 2 | 1; | |
| 37 | # ABSTRACT: (DEPRECATED) Trim whitespaces at the end of string | ||
| 38 | |||
| 39 | __END__ | ||