$_ = 'dogcatfood'; my $l = length; my $r = sprintf "%${l}.0f\n", rand (10 ** $l);