Gossamer Forum
Home : General : Perl Programming :

Perl help....

Quote Reply
Perl help....
Well, I just starting to learn perl, and I can't do this:
assign to an array a random number between 1000-1100. I tried :
#!usr/bin/perl -w

$rand =rand(100);
$rand=s/\.[0-9]*//;
print "le numero choisi est $rand" ;

but it didn't work....


theuls

---------------------------------
surfootball.com your soccer index
Quote Reply
Re: Perl help.... In reply to
I figured that one out by myself:

@array=(10000..19999);
$a =$array[rand @array];
print $a;


theuls

---------------------------------
surfootball.com your soccer index