Hi!,
Bringing this back up from a old post as its more relevant to this forum.
I'm trying to add a random number via a global tag but no luck as I know nowt about programming. The output needs letters and numbers and be as accurate (random) as possible.
So far I have code below but it doesn't work (errors):
<%random%>
sub {
# Displays random number/letter.
my @dig = ('0..9', 'a..z', 'A..Z');
srand(time ^ $$);
for (my $i = 0; $i++ < 8;) {
$RAND .= $dig[rand(@dig)];
}
}
any help with this would be great and I'm sure other could use this too.
Bringing this back up from a old post as its more relevant to this forum.
I'm trying to add a random number via a global tag but no luck as I know nowt about programming. The output needs letters and numbers and be as accurate (random) as possible.
So far I have code below but it doesn't work (errors):
<%random%>
sub {
# Displays random number/letter.
my @dig = ('0..9', 'a..z', 'A..Z');
srand(time ^ $$);
for (my $i = 0; $i++ < 8;) {
$RAND .= $dig[rand(@dig)];
}
}
any help with this would be great and I'm sure other could use this too.