----- Original Message ----

> From: Daniel Ruoso <dan...@ruoso.com>

>   my $word = 'banana';
>   my @guess = ;
>   $word ~~ /a/;
>   @guess[$/.from] = 'a';
>   say @guess;

So far my workarounds for this problem are failing because as soon as you take 
your code and refactor:

  my $word  = 'banana';
 
my @guess = < ? ? ? ? ? ? >;
  my $letter = 'a';
 
$word ~~ / <$letter> /;
  @guess[$/.from] = $letter;
  say @guess;

 
(I *think* that's the correct syntax?)

But that gives the following error:

Statement not terminated properly at line 4, near "$letter> /"

Revision 34446 on OS X Darwin.  Is this a known failure?  I think it's not 
supposed to work yet, but I unsure from the tests.  If that's the case, the 
only work around I can think of is to split the word and individually compare 
each letter's ord() value.

Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://use.perl.org/~Ovid/journal/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

Reply via email to