看到Wget下载工具的进度条挺cool的,就想用Perl来模仿下,折腾了半天,捣鼓出来这么一丑陋的东西 | | | $|=1; | | $n=1; | | $y=1024; | | $x=100; | | $num=2012; | | $a=int rand(10); | | while ($n<41) { | | printf "%3d",$n*2.5; | | print "%","["."=" x $n . ">"." " x (40-$n) ."]"." ", $num+$a ," $random K/s" ," ETA 00:0$a","\b" x 100; | | $n++; | | $num+=10; | | $a=int rand(10); | | $random = int( rand( $y-$x+1 ) ) + $x; | | system("ping /n 2 127.0.0.1>nul"); | | }COPY |
#经batman版主提醒修改了一下,还是感觉太丑了 |