perl脚本实现批量生成手机号码存放到文件中

print "Hello World";
open LOG, ">xrs.txt";
print LOG "I love world";
$count=30;
$i=1;
while($i<$count)
{
$i+=1;
$temp=sprintf("%0*s\n",10,$i);
print LOG $temp;
}

close LOG;


运行效果

I love world0000000002
0000000003
0000000004
0000000005
0000000006
0000000007
0000000008
0000000009
0000000010
0000000011
0000000012
0000000013
0000000014
0000000015
0000000016
0000000017
0000000018
0000000019
0000000020
0000000021
0000000022
0000000023
0000000024
0000000025
0000000026
0000000027
0000000028
0000000029
0000000030

猜你喜欢

转载自blog.csdn.net/xiexie1357/article/details/39928323