Here is one way to do it in Perl:
sub get_random_name ()
{
my @chars = ('a' .. 'z', 'A' .. 'Z');
my $ random_string;
foreach (1..22) {# rand @chars will generate random # numbers from 0 to scalar @chars $ random_string. = $ chars [rand @chars]; } return $ random_string. "-". time(); }
I don’t remember how long it takes part of the time (), so you may have to adjust the numbers corresponding to your length. You can also remove this part if you do not need it.
Anders sandvig
source share