#!/usr/bin/perl -w use strict; use Storable; for(my $i=0;$i<1e4;$i+=100){ my @A = (1..$i); my %H = (1..$i); store \@A,"tab$i"; store \%H,"hsh$i"; print $i, " ", -s "tab$i",' ', -s "hsh$i", "\n"; unlink "tab$i","hsh$i"; }