first commit

This commit is contained in:
douboer
2025-09-17 16:08:16 +08:00
parent 9395faa6b2
commit 3ff47c11d5
1318 changed files with 117477 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
###
### dir-walk-sizehash
###
## Chapter 1 section 5
sub file {
my $file = shift;
[short($file), -s $file];
}
sub short {
my $path = shift;
$path =~ s{.*/}{};
$path;
}
sub dir {
my ($dir, @subdirs) = @_;
my %new_hash;
for (@subdirs) {
my ($subdir_name, $subdir_structure) = @$_;
$new_hash{$subdir_name} = $subdir_structure;
}
return [short($dir), \%new_hash];
}