Summary says it all. Found this while reading my git clone's code.
Created attachment 10890 [details] [review] Initialized $stemmed_operand to q{} (perl critic friendly empty string)
perlcritic does not report this as a PBP violation. Running perlcritic on C4/Search.pm in master results in: C4/Search.pm source OK PBP does recommend using my $string = q{}; instead of my $string = ""; or my $string = ''; but does not make a judgement on my $string; I believe this rule applies to re-initializing a previously used variable to an empty string, no initializing it to begin with.
This is a valid bug. The perlcritic friendly bit is using q{} instead of ''.
I'm guessing that the point of this bug is that the variable is concatenated with itself, even though it is undef, which will result in a warning. In that case, I see how this is a valid bug, but the description of the bug did not describe that.
Created attachment 10910 [details] [review] Bug 8458 - $stemmed_operand in C4::Search _build_stemmed_operand is not initialized. Added =q{} to initialize it to the empty string at declaration time. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(In reply to comment #5) > Created attachment 10910 [details] [review] > Bug 8458 - $stemmed_operand in C4::Search _build_stemmed_operand is not > initialized. Added =q{} to initialize it to the empty string at declaration > time. > > Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> passing QA, nice spotting! ------------ $ koha-qa.pl - d0ec5cf Bug 8458 - $stemmed_operand in C4::Search _build_stemmed_operand is not initialized. Added =q{} to initialize it to the empty string at declaration time. C4/Search.pm - perlcritic-progressive tests... OK - perl -c syntax tests... OK
Pushed to 3.8.x will be in 3.8.4