Skip Menu |

This queue is for tickets about the Net-TFTP CPAN distribution.

Report information
The Basics
Id: 94038
Status: new
Priority: 0/
Queue: Net-TFTP

People
Owner: Nobody in particular
Requestors: gerph [...] gerph.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: undefined behaviour of 'my' variables with conditional
The use of 'my' with a conditional execution is undefined: sub get { my($self,$remote) = splice(@_,0,2); Show quoted text
> my $local = shift if @_ % 2;
my %arg = ( %$self, @_ ); See perlsyn: NOTE: The behaviour of a "my" statement modified with a statement modifier conditional or loop construct (e.g. "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. This code should be changed to make the conditional on variable assignment not declaration (or use a ternary operation, or similer).