[Chicago-talk] Using a hash in a regex
Andy Lester
andy at petdance.com
Thu Jul 13 14:19:51 PDT 2006
On Jul 13, 2006, at 4:17 PM, Jonathan Rockway wrote:
> I'm confused as to what the "two-argument" form of m// is. Am I
> missing
> something?
>
>> No, you have to loop manually.
>>
>> for my $key ( keys %h ) {
>> if ( m/$s/$key/ ) {
>> $n = $h{$key};
ooops I meant $s =~ /$key/
The other thing is that if you're not using regex characters, Jay,
then use index() instead of the regex. If you're searching for the
string "income" then don't go thru a regex to do it.
--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance
More information about the Chicago-talk
mailing list