in reply to Re^2: simple IPC needed
in thread simple IPC needed
#!/usr/bin/perl -w use strict; use Tk; my $mw = MainWindow->new(); my $file_name = 'Some file'; $mw->send('Foo' => $file_name); #!/usr/bin/perl -Tw use strict; use Tk; my $main_window = MainWindow->new(-title => 'My other prog'); $main_window->appname('Foo'); MainLoop; sub Tk::Receive{ shift; my $string = shift; if (my ($file) = $string =~ /^([^-]+)$/){ print "Got: $file\n"; exit 0; } else { print "Wrong arg Received\n"; exit 1; } }
|
|---|