my @string = join (" ",@words,@words2,@words3); print @string; my @sortedwords = sort @string; print "\n@sortedwords\n";