use strict; use warnings; open my $tr,"<",'file.csv' or die "Failure opening data file: $!"; while (<$tr>) { my ($x,$y,$z) = split /,/; print "x: $x\n"; }