Re: match not matching

2014-03-01 Thread Jim Gibson
On Feb 28, 2014, at 9:13 PM, Bill McCormick wrote: > Can somebody help me understand this? Given this loop, and the logged output > following ... > > my $found; > for( @$products ) {; > $found = $$_ =~ m|$project|; > $dump = Data::Dumper->Dump([$_, $project, $$_, $found]); > $logger->trace(

Re: match not matching

2014-03-01 Thread Dr.Ruud
On 2014-03-01 06:13, Bill McCormick wrote: $found = $$_ =~ m|$project|; Alternative: $found = ( index( $project, $$_ ) >= 0 ); or rather use: $found = $project =~ /\b\Q$$_\E\b/; Always add escaping and anchors, or you will match the unmatchable. -- Ruud -- To unsubscribe, e-mail: be

Re: match not matching

2014-03-01 Thread Bill McCormick
On 3/1/2014 6:19 AM, Paul Johnson wrote: On Fri, Feb 28, 2014 at 11:13:05PM -0600, Bill McCormick wrote: Can somebody help me understand this? Given this loop, and the logged output following ... my $found; for( @$products ) {; $found = $$_ =~ m|$project|; I think you might have meant:

Re: match not matching

2014-03-01 Thread Paul Johnson
On Fri, Feb 28, 2014 at 11:13:05PM -0600, Bill McCormick wrote: > Can somebody help me understand this? Given this loop, and the > logged output following ... > > my $found; > for( @$products ) {; > $found = $$_ =~ m|$project|; I think you might have meant: $found = $project =~ m|$$_|; >

match not matching

2014-02-28 Thread Bill McCormick
Can somebody help me understand this? Given this loop, and the logged output following ... my $found; for( @$products ) {; $found = $$_ =~ m|$project|; $dump = Data::Dumper->Dump([$_, $project, $$_, $found]); $logger->trace(qq(dump=$dump)); } I can't explain why $found is not true on the