while(){ chomp; /(\w+)\s+(\w+)/; print "$i : $2\,$1\n"; $list{$i} = [$1,$2]; $i+=1; }