perl 随机生成文件

 同窗叫我帮他写一个批量重命名文件的脚本,我是用shell写的,我想把它用perl改写一下,前提要有一些文件,就先生成一些文件:shell

 #!/usr/bin/perl -wide

while(1){spa

my $rand = int(99999+ rand(1000));it

if ($rand < 100899){ast

        $file = ">$rand.jpeg";class

        open(FILE,$file);file

        close(FILE);perl

        }else{命名

        last;脚本

        }

}

相关文章
相关标签/搜索