Coding Challenge #2! (115)

99 Name: #!/usr/bin/anonymous : 2007-10-21 12:16 ID:PQV22FrQ

[code]
#!/usr/bin/perl
use strict;
use warnings;
my $sleep = 2000+int(rand(1500)); #Some days are better for fishing than others
open(FISH, "fish.data") || die("Couldn't open fish.data $!");
my @fish = <FISH>;
my $fish = @fish;
close(FISH);

foreach my $typeOfFish (@fish) {

chomp $typeOfFish;

}

while (1) {

my $thisIsTheFloorGrid = int(rand(80)) +1;
my $typeOfFish = @fish[int(rand($fish))];
system("xmessage A $typeOfFish appears in grid $thisIsTheFloorGrid");
sleep $sleep+int(rand(800));

}
[/code]
http://www.dilbert.com/comics/dilbert/archive/dilbert-20070930.html

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: