On Feb 28, 2014, at 9:13 PM, Bill McCormick <wpmccorm...@gmail.com> 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(qq(dump=$dump));
> }
> 
> I can't explain why $found is not true on the 3rd pass. Does this have 
> something to do with the way I'm dereferencing the blessed object?
> 
> SVN.Hooks - dump=$VAR1 = bless( do{\(my $o = 'FS1100-S1')}, 
> 'RPC::XML::string' );
> $VAR2 = 'STABLE/FS1100-S3/RSLOGIX_5000/';
> $VAR3 = 'FS1100-S1';
> $VAR4 = '';
> SVN.Hooks - dump=$VAR1 = bless( do{\(my $o = 'FS1100-S2')}, 
> 'RPC::XML::string' );
> $VAR2 = 'STABLE/FS1100-S3/RSLOGIX_5000/';
> $VAR3 = 'FS1100-S2';
> $VAR4 = '';
> SVN.Hooks - dump=$VAR1 = bless( do{\(my $o = 'FS1100-S3')}, 
> 'RPC::XML::string' );
> $VAR2 = 'STABLE/FS1100-S3/RSLOGIX_5000/';
> $VAR3 = 'FS1100-S3';
> $VAR4 = '';


You have inverted the regular expression. You want this:

for( @$products ) {;
 $found = $project =~ m|$$_|;


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to