sub read_file { @lines = <>; chomp(@lines); for $line (@lines) { print join "\n", split ',', $line; print "\n" } } read_file; #### $: perl 1158919.pl < Arsenal Cech Bellerin Per Koscielny Nacho Ramsey Coquelin Alexis Ozil Welbeck Giroud $: