Wytch wrote:
> 
> I decided to write a little script to help choose who will make the tea on
> our gaming night [there is always an argument!]
> 
> I thought I was doing quite well but it seems I am picked on by the
> [non]random script I wrote! It seems to default to the first word in the
> array.
> 
> I used rand @array;
> 
> I think perhaps that I am thinking about it too simply and perhaps I need to
> involve more math - but I am not good at maths [though I am willing and a
> quick learner...lol] ! so can anyone point me in the right direction?
> 
> #!c:/perl/perl.exe
> 
> @tea = "Meba", "Shaun", "Mark", "Jason", "Rick", "Dan";

$ perl -le'
@tea = "Meba", "Shaun", "Mark", "Jason", "Rick", "Dan";
print "@tea";
'
Meba


If you had warnings enabled Perl would have caught this for tou.

$ perl -wle'
my @tea = "Meba", "Shaun", "Mark", "Jason", "Rick", "Dan";
print "@tea";
'
Useless use of a constant in void context at -e line 2.
Useless use of a constant in void context at -e line 2.
Useless use of a constant in void context at -e line 2.
Useless use of a constant in void context at -e line 2.
Useless use of a constant in void context at -e line 2.
Meba


#!c:/perl/perl.exe
use warnings;
use strict;

my @tea = qw/Meba Shaun Mark Jason Rick Dan/;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to