use strict;
package util;
sub beautify {
my ($in) = @_;
my $tmp;
foreach (split(/\s/o, lc($in))){
$tmp .= ucfirst($_);
$tmp .= ' ';
}
$tmp =~ s/\s$//;
return($tmp);
}
1;
####
use utf8;
use util;
use Test::More tests => 4;
is( &util::beautify( "àisTheWord"), "Àistheword", "àisTheWord - special character changes case." );
is( &util::beautify( "ùisTheWord"), "Ùistheword", "ùisTheWord - special character changes case." );
is( &util::beautify( "üisTheWord"), "Üistheword", "üisTheWord - special character changes case." );
is( &util::beautify( "ÿisTheWord"), "Ÿistheword", "ÿisTheWord - special character changes case." );
print util::beautify( "ÿisTheWord") . "\n";
####
1..4
ok 1 - ?isTheWord - special character changes case.
ok 2 - ?isTheWord - special character changes case.
ok 3 - ?isTheWord - special character changes case.
ok 4 - ?isTheWord - special character changes case.
Ÿistheword