#! perl -slw use strict; sub readfile { local $/; ## enable slurp mode; my @lines = map{ split ',', } split "\n", <>; ## split file by lines, then lines on commas. return @lines; } my @lines = readfile(); print for @lines; __END__ C:\test>1158919 junk.dat Cech Bellerin Per Koscielny Nacho Ramsey Coquelin Alexis Ozil Welbeck Giroud