Steven's Blog

A Dream Land of Peace!

使用Perl来批量创建目录

I use this script to generate chapters at once. The number of chapters you want to generate in passed through the command line as the first argument.

1
2
3
4
5
6
7
8
9
10
use strict;
use warnings;
use utf8;
use Data::Dumper;

my $chap_num = $ARGV[0];

for(my $i = 1; $i <= $chap_num; $i++){
    mkdir "chap_$i";
}