in reply to phrase marking

how to club the words of the marked phrase in the sentence as a single unit (i.e. the phrase appears in a single array element when the split is done on the sentence on the space character).
If you don't mind temporarily mangling your marked sentence (and don't already have quotes in your sentence), you could use Text::ParseWords.
use strict; use warnings; use Text::ParseWords; use Data::Dumper; my $marked = 'Jack and Jill went #up the hill# to fetch a #pail of wat +er#.'; $marked =~ s/#/"/g; my @words = shellwords($marked); print Dumper(\@words); __END__ $VAR1 = [ 'Jack', 'and', 'Jill', 'went', 'up the hill', 'to', 'fetch', 'a', 'pail of water.' ];