Subject: | Problems with Tk in taint-Mode |
When running this short script with Tk804.027
#!/usr/bin/perl -T
use Tk;
use Tk::ProgressBar;
my $percent_done;
my $mainwindow = MainWindow->new;
$mainwindow->ProgressBar(-variable => \$percent_done)->pack();
Tk::MainLoop();
the following errors occur:
Tk::Error: Can't set -variable to `SCALAR(0x81679f8)' for Tk::ProgressBar=HASH(0x8486180): Bizarre copy of ARRAY in leave at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Trace.pm line 89.
at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Derived.pm line 294
Tk callback for .
Tk callback for .progressbar
Tk::Derived::configure at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Derived.pm line 306
Tk::Widget::new at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Widget.pm line 205
Tk::Widget::__ANON__ at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Widget.pm line 256
Can't set -variable to `SCALAR(0x81679f8)' for Tk::ProgressBar=HASH(0x8486180): Bizarre copy of ARRAY in leave at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Trace.pm line 89.
at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Derived.pm line 294
at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Derived.pm line 306
XS_Tk__Callback_Call error:Bizarre copy of ARRAY in leave at /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi/Tk/Trace.pm line 89.
This error messages are from a SuSE Linux 9.1 installation but they are not dependant on the OS-Release or on the perl version. I've tested it unter perl 5.8.3, 5.8.5 and 5.8.6 on different platforms (Solaris, HP-UX and Linux) with the same results.
The script runs well under Tk800.025 or without the "-T" switch. I agree with the statements in "Programming Perl": Running scripts unter the -T flag isn't just a good idea: it's the law!
perl -v says: This is perl, v5.8.3 built for i586-linux-thread-multi
uname -a says: Linux gandalf 2.6.5-7.108-default #1 Wed Aug 25 13:34:40 UTC 2004 i686 i686 i386 GNU/Linux