#!/usr/bin/perl use warnings; use strict; my $PHONE_FILE = 'phones.txt'; open(PHONE_FILE, $PHONE_FILE) or die "Can't open file: $!\n"; my @lines = ; foreach $_ (@lines) { my @columns = split('\t', $_); my $col1 = $columns[0]; my $col2 = $columns[1]; chomp $col1; print "\$columns[0]\t$columns[1]\n"; } #### Apple iPhone 4 test Apple iPhone 4s test1 Apple iPhone 3G test2 Apple iPhone 3GS test3 #### $columns[0] test $columns[0] test1 $columns[0] test2 $columns[0] test3