in reply to Reg Expression Question
Or, less idiomaticallymy %hash = map {$_=>1} (0,5,8,15,20); for my $i (0..30) { print "I am number $i\n" if $hash{$i}; }
my %hash = (0 => 1, 5 => 1, 8 => 1, 15 => 1, 20 => 1); for my $i (0..30) { if ($hash{$i}) { print "I am number $i\n"; } }
-Blake
|
|---|