perlの変数のデータ量を調べたいということがあって、何を使ったらいいか調べたんだけど、Devel::Sizeというのが便利そうだった。 こんなかんじで使える。 use Devel::Size qw(size total_size); my $size = size([1, 2, 3, 4, 5]); warn $size; my $total_size = total_size({ a => [1, 2, 3], b => { c => [1, 3, 5], }, }); warn $total_size; sizeというのは構造のために使われている容量を出してくれるやつ。 The size function returns the amount of memory the variable returns. If the variable is a hash or an array,