> my $random_key = ( keys %tips )[ rand keys %tips ];

> Can anyone parse this line for me?

Picking up a random key from the keys of a hash.

see perldoc -f rand


>>One more thing - I don't seem to have perldoc installed, I simply look up
>>the functions in the info node `perlfunc'. Am I missing something?

perldoc is not a function but a utility.

try "perldoc perldoc".

-Sharad

-----Original Message-----
From: Abhijit Shylanath [mailto:[EMAIL PROTECTED]
Sent: Friday, June 20, 2003 11:33 AM
To: Dan Muey
Cc: Perl Beginners
Subject: RE: Removing entries from an array



> Well you could actually put them in a hash with a number as the key and
> the tip as th evalue then undefine the value of a key once it's used.

Won't that be an unnecesary waste of memory and clock cycles? How efficient
are the Perl hashing routines anyway?

> my $random_key = ( keys %tips )[ rand keys %tips ];

Can anyone parse this line for me?

One more thing - I don't seem to have perldoc installed, I simply look up
the functions in the info node `perlfunc'. Am I missing something?

--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/


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


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

Reply via email to