Subject: | Error in code handed to decomment caught properly into PPR::ERROR |
Date: | Thu, 23 Apr 2020 19:19:47 +0200 |
To: | bug-PPR [...] rt.cpan.org |
From: | Albert <albert.tests [...] gmail.com> |
When we have a problem with a syntax error in it the PPR code normally
would define the PPR::ERROR, but some types of problems are not caught,
i.e. the method PPR::decomment returns nothing, but also PPR::ERROR is not
defined.
Such a situation is (note the 2 closing curly brackets of is_top_level0,
the open statements are not a problem, but a result of other tests):
sub is_top_level0 { # with comment
my $function = "";
return $function;
}
}
open (DFILE, $diff) or die "SHOULD NOT BE PRESENT!!!!!!!!!!!!!!!1";
sub is_top_level1 {
my $function = "";
return $function;
}
open (DFILE, $diff) or die "SHOULD NOT BE PRESENT!!!!!!!!!!!!!!!";
and the used code:
my $aFileData = read_file($sFilename);
$aFileData =~ s/\r$//g;
my @aRawFileData= split /(?<=\n)/, $aFileData;
$self->{'_aRawFileData'} = \@aRawFileData;
my $aUncommentFileData_tmp = PPR::decomment(join($", $aFileData));
if (defined($PPR::ERROR))
{
$self->{'_aUncommentFileData'} = \@aRawFileData;
}
else
{
my @aUncommentFileData = split /(?<=\n)/, $aUncommentFileData_tmp;
$self->{'_aUncommentFileData'} = \@aUncommentFileData;
}
here the $aUncommentFileData_tmp is undefined after the call to
PPR::decomment.
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>