i am trying to generate an alpha-numeric number of size 5 using the perl rand function and print it to the screen.
i tried the following code but can't get it to work:
#my @alphanum = ( "A" .. "Z", "a" .. "z", 0 .. 9);
#my $random = join("", @alphanum map { rand @alphanum } ( 1 .. 5 ) ]);
print $random;
can anybody help,
thanks in advanced
scoobie.
Equivalent to:
#!/usr/bin/perl -w
use strict;
my @alphanum = ( 'A' .. 'Z', 'a' .. 'z', 0 .. 9);
my $random = join('', map($alphanum[rand($#alphanum)],(1..5)));
print "$random\n";