in reply to Re^4: Extracting Unique elementsin thread Extracting Unique elements
Just use join instead of a loop:
print FH ref($bar) eq "ARRAY" ? join(',', @$bar) : $bar; [download]