or download this
use Types::Standard qw( Str Maybe );
use Types::Common::String qw( StrLength );
...
ok( $MaybeCaption->check( undef ), 'Undef passes type constraint' );
ok( ! $MaybeCaption->check( [] ), 'Arrayref fails type constraint' );
is( $MaybeCaption->coerce( '' ), undef, 'Empty string coerced to undef
+' );