>>>>> "JP" == John Porter <jdporter@min.net> writes: JP> If you do a slice, then you have to keep track of your slice beginning. JP> Splice can always start at 0 -- ergo simpler code. but slice is usually faster since it doesn't have to shift elements. unless you do my trailing splice trick. >> $card = rand @deck, ( $deck[$card], $deck[$_] ) = ( $deck[$_], $deck[$card] ) >> for 0 .. $#deck ; JP> Oh, yeah, that's beautiful code. :-P i can't tell if you are being sarcastic. do you like it or not? i just whipped it out as a quickie shuffle (the latest dance craze). JP> $handsize = 5; # straight poker. JP> @hands = 5; # O.k., who's in? JP> @$_ = splice @deck, 0, $handsize for @hands; # too much fun. again with the bugs. that will only assign the hand @5 which is very odd. what do the other 4 players use for cards? stick with go fish and leave poker and bridge to the adults. :-) uri -- Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting Have Perl, Will Travel ----------------------------- http://www.sysarch.com The Best Search Engine on the Net ------------- http://www.northernlight.com "F**king Windows 98", said the general in South Park before shooting Bill. ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe