What about putting the results back into a variable (such as $results)? Do I need to do a concatenation in the while( ... $results .= $buf; ... ) or is there a better way to store the output in a variable?
print "I am finished with my task. My results are: \n";
# where are my results stored if I want them in a variable?
# print $results;