in reply to Re: Basic optimization questions
in thread Basic optimization questions

The first option is the correct one. Assigning undef is a waste of typing.

Not necessarily. Assigning undef has semantic meaning to some people. To them, "my $var = undef;" means "I am intentionally initialising it to undef, a value I might use.", and "my $var;" means "I am declaring a variable, but I still need to assign a value to it before using it."

I just use "my $var;" unconditionally.