in reply to dump a string into array

First of all your code is not working....and for your first question if $stemmed_words is an array reference than only it will give output as you have written