Subject: | warning when setting textvariable to undef |
Widgets such as Label which can be created with a textVariable. If the variable is cleared by assigning undef, then a warning like this will be printed:
I observed this in the widget demo program (menus2.pl); I also noticed that the menus.pl demo uses an empty string instead of undef to clear the Label, possibly as a workaround to prevent this warning. But for compatibility with Perl/Tk, and to go along with the more general convention that using undef as a string should be the same as using an empty string, this might be something to support. (Though I think assigning an empty string to clear the Label shows what the intention is more clearly.)
I'm not sure where this might be addressed, but I wonder if this is due to something in Tcl.xs (from Tcl.pm), since when using the debugger, there's nothing to step into right after the statements where undef is assigned; the warning shows up, and I'm already on the next line.
Use of uninitialized value in subroutine entry at /opt/local/lib/perl5/vendor_perl/5.26/Tcl/pTk/demos/widget_lib/menus2.pl line 195.
I observed this in the widget demo program (menus2.pl); I also noticed that the menus.pl demo uses an empty string instead of undef to clear the Label, possibly as a workaround to prevent this warning. But for compatibility with Perl/Tk, and to go along with the more general convention that using undef as a string should be the same as using an empty string, this might be something to support. (Though I think assigning an empty string to clear the Label shows what the intention is more clearly.)
I'm not sure where this might be addressed, but I wonder if this is due to something in Tcl.xs (from Tcl.pm), since when using the debugger, there's nothing to step into right after the statements where undef is assigned; the warning shows up, and I'm already on the next line.