my @arr = (q{ one }, q{ two three }); for (@arr){ my $trimmed = join q{ }, split; printf qq{*%s*\n}, $trimmed; } #### *one* *two three*