Edit executavble command to make random number generator in Perl


I was using this module for Perl, Crypt::PRNG, to generate random numbers. The number-generation seems truly random when using the random string command, it can use digits 0-9 as well as other characters and create a random string of the specified number of digits, the problem is the leading 0's.

perl -MCrypt::PRNG=:all -E "say random_string_from("1234567890", n)"

where n is the number of digits, is there a executable command similar to the one above to fix the leading 0's so I can for sure get an n digit number? My intent is to fix only the first digit to "123456789". Does anyone know how to do this? Thanks in advance.

By : J. Linne


Put the Crypt::PRNG code in a while loop until the leading character is not a 0.

By : zaph

How about

random_string_from("123456789", 1) . random_string_from("1234567890", $n-1)
By : redneb

Disable attribute only associates button and input filelds, the thing you want to do here is , event.preventDefault . It will work like disable, but it will depend upon your coding, if you want to show it disabled, you have to add add via jquery

This video can help you solving your question :)
By: admin