view prog/04.pl @ 3:d3e201c48ff8 draft default tip

bug fix.
author pyon
date Wed, 29 Sep 2021 22:04:51 +0900
parents 520044113ef0
children
line wrap: on
line source

# ランダム文字列でファイルを埋める

my @z = split //, "abcdefghijklmnopqrstuvwxyz0123456789";
for (1..541) {
	my $fn;
	$fn .= $z[int(rand scalar @z)] for (1..8);
	$fn .= sprintf "%04d", $_;
	$fn .= $z[int(rand scalar @z)] for (1..4);

	open my $f, '>', $fn;
	for (1..1024) {
		print {$f} $z[int(rand scalar @z)] for (1..48);
		print {$f} "\n";
	}
	close $f;
}