| 1 | package MDOM::Util; | ||||||||||
| 2 | |||||||||||
| 3 | 16 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 16 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 16 | ▶ | use base 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 16 | our @EXPORT_OK = qw( | |||||||||
| 8 | trim_tokens | ||||||||||
| 9 | ); | ||||||||||
| 10 | |||||||||||
| 11 | sub trim_tokens ($) { | ||||||||||
| 12 | 12 | ▶ | my $tokens = shift; | ||||||||
|
Subroutine
trim_tokens: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||
| 13 | 12 | ▶ | return if !@$tokens; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 9 | ▶ | if ($tokens->[0] =~ /^\s+$/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 6 | shift @$tokens; | |||||||||
| 16 | } | ||||||||||
| 17 | 9 | ▶ | return if !@$tokens; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 9 | ▶ | if ($tokens->[-1] =~ /^\s+$/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 7 | pop @$tokens; | |||||||||
| 20 | } | ||||||||||
| 21 | } | ||||||||||
| 22 | |||||||||||
| 23 | 16 | 1; | |||||||||