Hi All,
How do I generate random numbers using arrays in PERL.
Thank you,
Using the rand function: http://perlmeme.org/howtos/perlfunc/rand_function.html
Google it before asking.
int(rand(10));
print rand;
Hi All,
thank you all for your responses, now how do I Insert a random number as the 3rd element in the array
Thanks
my $rand=int(rand(10));
my @array;
$array[2]=$rand;
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.