Non si sa mai a qualcuno al volo può servire 🙂 Vi copio una funzione per la generazione casuale di stringhe in PERL o Perl Random String Generator. La funzione consente di passare una variabile numerica per specificare la lunghezza della stringa.
sub random_string_generator_perl
{
#lunghezza della stringa da generare
my $length_of_random_string=shift;
# the random string to generate
my @chars=('a'..'z','A'..'Z','0'..'9');
my $random_string;
foreach (1..$length_of_random_string)
{
$random_string_perl.=$chars[rand @chars];
}
return $random_string_perl;
}
my $randomID= &random_string_generator_perl(11);
Hai bisogno di una consulenza o assistenza?
Apri un ticket di richiesta, ti risponderò in brevissimo tempo! Chiedere non costa nulla 😉

