in reply to Tk - is MainWindow robust?

I would use local for tweaking the environment variable:

use strict; use Tk; my @Displays = qw"node1:0 node2:0"; my $top = MainWindow->new(); my %top; foreach (@Displays) { local $ENV{'DISPLAY'} = $_; if (eval {$top{$_} = MainWindow->new()}) { print "MainWindow opened on $_\n"; } else { print "MainWindow failed to open on $_\n"; $top{$_} = 0; } } MainLoop;

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)

Replies are listed 'Best First'.
Re^2: Tk - is MainWindow robust?
by matt.tovey (Beadle) on Dec 01, 2005 at 13:35 UTC
    Good tip - thanks.