sub yoda { my ($sentence) = @_; my $Pivot=join '|',qw/is be will show do try are teach have/; # Move along, nothing to see here return $sentence unless ($sentence=~/\b$Pivot\b/); # Rearrange our words $sentence="$' $`$&"; # Clear leading spaces and Capitalise $sentence =~ s/^\s+//; $sentence = ucfirst(lc($sentence)); };