use strict; use warnings; print $_ for my ($data) = split ',', ; __DATA__ 123,456 234,567 345,456 #outputs: '123'