Dallycot
view release on metacpan or search on metacpan
lib/Dallycot/Library/Core/Strings.pm view on Meta::CPAN
if(!$patt) {
@bits = split( /\s+/, $source );
}
else {
my $count;
if($max_count) {
if ( $max_count->isa('Dallycot::Value::Numeric') ) {
$count = $max_count->value->numify;
}
else {
croak 'Limit for string-split must be numeric';
}
}
if($patt -> isa('Dallycot::Value::String')) {
if($count) {
@bits = split($patt -> value, $source, $count);
}
else {
@bits = split($patt -> value, $source);
}
}
else {
croak 'Pattern for string-split must be a string';
}
}
return Dallycot::Value::Vector->new(
map {
Dallycot::Value::String->new($_, $string->lang)
} @bits
);
};
define
( run in 1.897 second using v1.01-cache-2.11-cpan-71847e10f99 )