| 1 | package MooseX::Types::Buf; | ||
| 2 | |||
| 3 | 1 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | our $VERSION = '0.01'; | |
| 8 | |||
| 9 | 1 | ▶ | use Encode (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 1 | ▶ | use Moose::Util::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 1 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 2 | ▶ | subtype Buf => as 'Str' => where { not Encode::is_utf8($_) }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 1 | ▶ | coerce Buf => from Str => via { Encode::encode_utf8($_) }; |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 16 | 0 | ▶ | coerce Str => from Buf => via { $_ }; |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 17 | |||
| 18 | 1 | 1; | |
| 19 | |||
| 20 | __END__ | ||