for (sort {$file{$a}[1] <=> $file{$b}[1]} @keys) {
for $box (@{$data{$_}}) {
}

すみません、これはどういうことを表しているのでしょうか?