perl如何循环读取文本文件内容

perl如何循环读取文本文件内容

perl如何循环读取文本文件内容
#cat list.txt
zhangsan#beijing#8456874
lisi#shanghai#8452136
....

perl如何循环读出list.txt文本内容
传值给 $a =zhangsan $b=beijing $c=8456874
..

记得shell 里面比较简单啊

for a in `cat list.txt`
do
..
done

就可以的了 .
perl新手,请教下
open(MYFILE,
open(MYFILE, "list.txt") || "File is not exist!";
while(<MYFILE>){
print $_;
}
close(MYFILE);




   

用perl更简单:--#perl .
用perl更简单:
#perl -e 'map{($a,$b,$c)=split /#/} <>' list.txt