#!/usr/bin/perl use warnings; use strict; open FILE1, '<', "file1name" or die "input1 error $!"; while (my $line = ) { chomp $line; #remove line endings my ($name1,$name2,$name3,$name4,$name5) = split ' ',$line; #use some names that describe what you columns really #mean usually col1, col2 is a bad idea. # put some print statements here to make sure that # you can actually get the 5 individual things }