line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package String::Iota; |
2
|
1
|
|
|
1
|
|
21313
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
225
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
require Exporter; |
6
|
|
|
|
|
|
|
our @EXPORT = qw( |
7
|
|
|
|
|
|
|
trim |
8
|
|
|
|
|
|
|
); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.85'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub trim { |
13
|
0
|
|
|
0
|
1
|
|
my ($string, $pat) = @_; |
14
|
0
|
|
0
|
|
|
|
$string ||= $_; |
15
|
0
|
|
|
|
|
|
my @chars = split //, $string; |
16
|
0
|
|
|
|
|
|
return join "", @chars[0..--$pat]; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub strim { |
20
|
0
|
|
|
0
|
1
|
|
my ($string, $pat) = @_; |
21
|
0
|
|
0
|
|
|
|
$string ||= $_; |
22
|
0
|
|
|
|
|
|
$string = scalar reverse $string; |
23
|
0
|
|
|
|
|
|
$string =~ s/.*${pat}(.*)/$1/; |
24
|
0
|
|
|
|
|
|
return scalar reverse $string; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub dismantle { |
28
|
0
|
|
|
0
|
1
|
|
my $string = shift; |
29
|
0
|
|
|
|
|
|
return my @info = (length $string, split //, $string ); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |