#!perl -w use strict; require Tk; use Tk; my $row=1; my $filename="example_out.htm"; my %stuff1=( 'thing01_a' => "value01_a", 'thing02_a' => "value02_a", 'thing03_a' => "value03_a", 'thing04_a' => "value04_a", 'thing05_a' => "value05_a", 'thing06_a' => "value06_a", 'thing07_a' => "value07_a", 'thing08_a' => "value08_a", 'thing09_a' => "value09_a", 'thing10_a' => "value10_a" ); my %stuff2=( 'thing01_b' => "value01_b", 'thing02_b' => "value02_b", 'thing03_b' => "value03_b", 'thing04_b' => "value04_b", 'thing05_b' => "value05_b", 'thing06_b' => "value06_b", 'thing07_b' => "value07_b", 'thing08_b' => "value08_b", 'thing09_b' => "value09_b", 'thing10_b' => "value10_b" ); sub do_this() { open FILE, "> $filename" or die "ERROR WRITTING FILE: $filename\nSystem reported $!"; print FILE << "HTMLSTUFF"; TABLE O' STUFF

HTMLSTUFF if ($row == 1) {print FILE "\n"; $row=2;} elsif ($row == 2) {print FILE "\n"; $row=1;} foreach (sort keys(%stuff1) ) { print FILE "";} print FILE ""; if ($row == 1) {print FILE "\n"; $row=2;} elsif ($row == 2) {print FILE "\n"; $row=1;} foreach (sort keys(%stuff2) ) { print FILE "";} print FILE ""; print FILE "\n
THING 1 THING 2 THING 3 THING 4 THING 5 THING 6 THING 7 THING 8 THING 9 THING 10
$stuff1{$_}
$stuff2{$_}
"; close FILE; system "start /b $filename"; } my $fsize=12; my $main = MainWindow->new(); $main->title("Button Window"); $main->configure(-background=>'#c0c0c0'); $main->optionAdd('*BorderWidth' => 1); my $bottom = $main->Frame(-background=>'#c0c0c0')->pack(-expand=>0, -fill=>'both'); my $sub_button=$bottom->Button(-width=>40, -background=>"#c0c0c0", -fg=>'black', -text=>'CLICK ME', -font => ['Courier', 10], -command=>\&click); $sub_button->pack(-side => "bottom", -anchor => "s", -expand => "n", -fill => "none"); MainLoop(); sub click() { do_this(); }