]> git.proxmox.com Git - pve-container.git/commit
fix #1792: Do not assign vars in conditional statement
authorWolfgang Link <w.link@proxmox.com>
Tue, 5 Jun 2018 10:58:47 +0000 (12:58 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 6 Jun 2018 13:26:22 +0000 (15:26 +0200)
commit9de0505c772f7c382c82d9bfb170b3e0664af9ed
treef38dd58fea80cf4e2b067a6f6034a4851bab6a0f
parent24f9d440a6391ec31ecfce869627a7910eb3f041
fix #1792: Do not assign vars in conditional statement

If a variable is defined and assigned in a conditional statement,
it is not defined behavior in Perl.

For more inforamtion about this behavior see
https://perldoc.perl.org/perlsyn.html#Statement-Modifiers

"NOTE: The behaviour of a my, state, or our modified with a statement
modifier conditional or loop construct (for example, my $x if ... )
is undefined.
The value of the my variable may be undef, any previously assigned
value, or possibly anything else.
Don't rely on it. Future versions of perl might do something different
from the version of perl you try it out on. Here be dragons."
src/PVE/LXC.pm