Net::Telnet and Tk prevent Perl from returning system commands on Windows

Posted by Alex Gorbachev on 2007-01-02 09:13

This reduced version of my code fails in line 13 ( for (1..5) {system ("echo
syscall $_")}) -- Perl cannot close the system call. Running this with Perl
5.8.8 on Win XP and Win 2000 with same result.

use Tk;
use Net::Telnet;

$main = MainWindow->new;

$main->Button( -text => DO,-command => (sub{do_work()}))->pack(qw/-pady
15 -padx 20/);
MainLoop;

sub do_work {
my $t = new Net::Telnet (Port => 25);
$t->open("yahoo.com") or print "Cannot connect";
$t->close;
for (1..5) {system ("echo syscall $_")}
}

kevinw
ActiveState Staff
Wed, 2007-01-03 12:44

This was filed as bug 65304 and can be seen at http://bugs.activestate.com/show_bug.cgi?id=65304.