molecules has asked for the wisdom of the Perl Monks concerning the following question:
when clearly it is in the array. Am I doing something wrong? Is it a future implementation issue?["1", "2", "3", "4"] scalar '1' not in 1 2 3 4
I'm using Rakudo Star on Windows 7, 64-bit.use v6; my @array = <1 2 3 4>; @array.perl.say; my $scalar = '1'; if $scalar ~~ @array { say 'scalar in array'; } else { say "scalar '$scalar' not in @array[]"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Perl6: Smartmatch scalar to array
by Fox (Pilgrim) on Aug 16, 2010 at 17:41 UTC | |
by TimToady (Parson) on Aug 16, 2010 at 20:14 UTC | |
by molecules (Monk) on Aug 18, 2010 at 17:36 UTC | |
by molecules (Monk) on Aug 16, 2010 at 18:38 UTC |