sub process_variables {
my ( $value, $remove_undef ) = @_;
$value =~ s/ (?<! \\ ) \$ \{ ( .*? ) \} /
defined $variable{ $1 }
? $variable{ $1 }
: defined $remove_undef && $remove_undef
# for if statements, any variable that is not defined,
# we simple convert to 0
? '0'
# This could be an option that is used later, save
# it so we don't warn if this option is not one of
# ktests options. And put back the origin piece.
: ( $used_options{ $1 } = 1 and "\${$1}" )
/exg;
return $value;
}
The code above produces the warning message:
Found = in conditional, should be == at file line n.
If I change:
( $used_options{ $1 } = 1 and "\${$1}" )
To:
do { $used_options{ $1 } = 1 and "\${$1}" }
I still get the same warning message.
But obviously the message is wrong because there is no = in conditional.
$ perl -v
This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-li
+nux-gnu-thread-multi
(with 90 registered patches, see perl -V for more detail)
Copyright 1987-2017, Larry Wall
Perl may be copied only under the terms of either the Artistic License
+ or the
GNU General Public License, which may be found in the Perl 5 source ki
+t.
Complete documentation for Perl, including FAQ lists, should be found
+on
this system using "man perl" or "perldoc perl". If you have access to
+ the
Internet, point your browser at http://www.perl.org/, the Perl Home Pa
+ge.