while(<>) { @parts = ($_ =~ /.{3}/g); $assign = "\$hash" . join('', map { "{\'$_\'}" } @parts) . "++;"; eval $assign; }