my %draw = (map {$_ => 1} qw/ ... /);
This is a good idea. [Minor point: the parentheses aren't necessary.]
my $hits = @draw{@$bet};
This is a less good idea: it isn't doing what you appear to think it does. See the following (and the examples that follow it) in "perldata: Slices":
"Slices in scalar context return the last item of the slice."
So, $hits will only ever equal 1 or undef, and the occasional correct output (e.g. "06 14 24 26 42 48 --> 1") will be just coincidence.
Update: Just it case it isn't clear: in list context, @draw{@$bet} will always contain six elements, each of which will be either 1 or undef.
-- Ken
In reply to Re^2: Lotto checker...
by kcott
in thread Lotto checker...
by fishy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |