#!/usr/bin/env perl use utf8; use Utils; use strict; use warnings; MAIN: { binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); binmode(STDIN, ":utf8"); my $str = "Four score and seven years ago..."; print "Split 1: ", Utils::listToString([split(qr/ /, $str)]), "\n"; print "Split 2: ", Utils::listToString([split(qr/[eo]/, $str)]), "\n"; print "Split 3: ", Utils::listToString([split(qr/\s/, $str)]), "\n"; print "Split 4: ", Utils::listToString([split(qr/\W/, $str)]), "\n"; }