Re: Question about match behaviour

2010-08-05 Thread Mike Martin
On 5 August 2010 03:39, John W. Krahn wrote: > Mike Martin wrote: >> >> Hi > > Hello, > >> I have the following code >> my $type='val'; >> my $type_g; >> foreach my $key (keys %options){ >> my $chk=$options{$key}->[3]; >> $type_g=$options{$key}->[4] if $chk=~/$type/; >> #$type_g=$options{$key}->[4

Re: Question about match behaviour

2010-08-05 Thread Mike Martin
- Show quoted text - On 5 August 2010 04:58, Chas. Owens wrote: > On Wed, Aug 4, 2010 at 11:36, Mike Martin wrote: > snip >> This fails but if I replace >> $type_g=$options{$key}->[4] if $chk=~/$type/ >> >> with either >> $type_g=$options{$key}->[4] if $type=~/$chk/; (ie:reversing the match) >> >

Re: Question about match behaviour

2010-08-04 Thread Chas. Owens
On Wed, Aug 4, 2010 at 11:36, Mike Martin wrote: snip > This fails but if I replace > $type_g=$options{$key}->[4] if $chk=~/$type/ > > with either > $type_g=$options{$key}->[4] if $type=~/$chk/; (ie:reversing the match) > > or > > $type_g=$options{$key}->[4] if $type eq $chk; > > any idea on the r

Re: Question about match behaviour

2010-08-04 Thread John W. Krahn
Mike Martin wrote: Hi Hello, I have the following code my $type='val'; my $type_g; foreach my $key (keys %options){ my $chk=$options{$key}->[3]; $type_g=$options{$key}->[4] if $chk=~/$type/; #$type_g=$options{$key}->[4] if $type=~/$chk/; } print "\n",$type,"\t",$type_g,"\n"; This fails but i

Question about match behaviour

2010-08-04 Thread Mike Martin
Hi I have the following code my $type='val'; my $type_g; foreach my $key (keys %options){ my $chk=$options{$key}->[3]; $type_g=$options{$key}->[4] if $chk=~/$type/; #$type_g=$options{$key}->[4] if $type=~/$chk/; } print "\n",$type,"\t",$type_g,"\n"; This fails but if I replace $type_g=$options{$ke