Re: [Fwd: Re: deck of cards the saga]

2007-07-09 Thread Jeff Pang
2007/7/10, Martin Barth <[EMAIL PROTECTED]>: for (@startingdeck) { s/A/Ace/; s/K/King/; s/Q/Queen/; s/J/Jack/; s/C/Club/; s/H/Heart/; s/D/Diamond/; s/S/Spade/; # s/J/Joker/; ##makes no sense, since j <- jack } Instead of multi-regex here,I think using a

Re: [Fwd: Re: deck of cards the saga]

2007-07-09 Thread Martin Barth
HTH, % perl test.pl 4 Diamond 9 Club 3 Spade Ace Spade 8 Diamond % cat test.pl #!/usr/bin/perl use strict; use warnings; my @startingdeck = ("A H","2 H","3 H","4 H","5 H","6 H","7 H","8 H", "9 H","10 H","J H","Q H","K H", "A D","2 D","3 D","4 D","5 D","6

Re: deck of cards the saga

2007-07-09 Thread Paul Lalli
On Jul 9, 4:36 am, [EMAIL PROTECTED] (Amichai Teumim) wrote: > In my deck of cards I want to replace the letter of the card with the name( > e.g. A = Ace). > > So I tried to implement the following snippet into my code: > > while @startingdeck{ > $_ =~ s/A/Ace/; > print NEW; > > } > Is the lo

[Fwd: Re: deck of cards the saga]

2007-07-09 Thread Martin Barth
--- Begin Message --- Hi Martin This changes the names, but bring horrible results: shift(@startingdeck), pop(@startingdeck), shift(@startingdeck), pop(@startingdeck), shift(@startingdeck), pop(@startingdeck)

Re: deck of cards the saga

2007-07-09 Thread Jeff Pang
2007/7/9, Amichai Teumim <[EMAIL PROTECTED]>: Hi In my deck of cards I want to replace the letter of the card with the name( e.g. A = Ace). You can also use a map to do this.ig, use strict; use warnings; my @startingdeck = ("A H","2 H","3 H","4 H","5 H","6 H","7 H","8 H", "9 H

deck of cards the saga

2007-07-09 Thread Amichai Teumim
Hi In my deck of cards I want to replace the letter of the card with the name( e.g. A = Ace). So I tried to implement the following snippet into my code: while @startingdeck{ $_ =~ s/A/Ace/; print NEW; } The code is as follows (including snippet): #!/usr/bin/perl use strict; use warnings;