| 1 | # | ||
| 2 | # (c) Jan Gehring <jan.gehring@gmail.com> | ||
| 3 | # | ||
| 4 | |||
| 5 | package Rex::Helper::URI; | ||
| 6 | |||
| 7 | 1 | ▶ | use v5.14.4; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | our $VERSION = '1.16.1'; # VERSION | |
| 11 | |||
| 12 | 0 | ▶ | sub encode { |
|
Subroutine
encode: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 13 | 0 | my ($part) = @_; | |
| 14 | 0 | $part =~ s/([^\w\-\.\@])/_encode_char($1)/eg; | |
| 15 | 0 | return $part; | |
| 16 | } | ||
| 17 | |||
| 18 | 0 | ▶ | sub _encode_char { |
|
Subroutine
_encode_char: not called CC=1 SCAR=6.9
| |||
| 19 | 0 | my ($char) = @_; | |
| 20 | 0 | return "%" . sprintf "%lx", ord($char); | |
| 21 | } | ||
| 22 | |||
| 23 | 1 | 1; | |