in reply to Columns to arrays

split() will do what you want, (see the documentation for split).
#!/usr/bin/perl use strict; use warnings; my @arr0 = (); my @arr1 = (); while(my $line = <DATA>) { chomp $line; # split on comma, to produce at most 2 fields # see perldoc -f split my @fields = split /,/, $line, 2; push @arr0, $fields[0]; push @arr1, $fields[1]; } print "arr0 = @arr0\narr1 = @arr1\n"; __DATA__ 112233AABBCC,Homer Simpson 223344BBCCDD,Marge Simpson 323498XXYYZZ,Bart,has,commas,in,his,name,Simpson