my @foo = qw(a b c d A "B C" D); # Test data... print join "|", @foo; # What the test data looks like print join "|", <@foo>; # do { Magic } :)