$i=1; foreach $line(@file) { chomp $line; ($numb,$text)=split(/\|\|/,$line); $numb[$i]=$numb; $text[$i]=$text; $i++; }