# you can name your arrays a,b,c,d,e if you want to, # but I won't my (@jobNumbers, @customerNames, @telephoneNumbers, @agencyReferences, @statusDescriptions); # assuming you're reading from STDIN, or # files named on the command line... while(<>) { if(!/ (.{6}) # job number, $1 (.{10}) # customer name, $2 (.{10}) # telephone number, $3 (.{10}) # agency reference, $4 (.{64}) # status description, $5, adjust to skip spaces /x) # allow comments and whitespace in regex { warn "Skipping badly formatted record '$_'"; next; } push @jobNumbers, $1; push @customerNames, $2; push @telephoneNumber, $3; push @agencyReferences, $4; push @statusDescriptions, $5; }