Hi All,

 

I'm trying to generate random sentences using a few words, but can't get
the thing to work...... 

I know I'm doing something wrong but what? :-D

 

Any help is appreciated!

 

 

#!/usr/bin/perl -w

#

 

my $count = "0";

 

my $word0 = "aap";

my $word1 = "nood";

my $word2 = "mies";

my $word3 = "boot";

my $word4 = "pet";

my $word5 = "boom";

my $word6 = "klok";

my $word7 = "bel";

my $word8 = "fiets";

my $word9 = "toeter";

 

while ($count < 5) {

  ++$count;

  print "Test number $count\n";

  wordgen();

}

 

sub wordgen {

  my $number = int(rand(10));

  $firstword = $word{$number};

  print "firstword is $firstword\n";

}

 

- 

Marco van Kammen
Springer Science+Business Media
System Manager & Postmaster 

- 

van Godewijckstraat 30 | 3311 GX
Office Number: 05E21 
Dordrecht | The Netherlands 

-  

tel 

 +31(78)6576446

fax 

 +31(78)6576302

- 

www.springeronline.com <http://www.springeronline.com>  
www.springer.com <http://www.springer.com/> 

- 

 

 

Reply via email to