Sisk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl #perl2exe_include Tk::Pane use Win32::SqlServer; use Tk; use Tk::Scrollbar; require Tk::Pane; my $mw=new MainWindow; # Main Window Elements my $titleBanner=$mw->Label(-text=>"*Text changed to protect the innoce +nt*",-font=>"Arial 12 bold")->pack(); my $testbutton=$mw->Button(-command=>\&destframe, -text=>"Refresh")->p +ack(); my $statusFrame=$mw->Scrolled('Frame',-scrollbars=>"oe")->pack(); &destframe; $mw->repeat(10000, \&destframe); # Subroutine to get data from the DB sub GetData{ my $sqlsrv=Win32::SqlServer::sql_init('*Deleted*','*Params*','*For +*','*Security*'); my $batch=<<SQLEND; SELECT firstname, lastname, status FROM *Now I'm just being paranoid* WHERE status is NOT NULL SQLEND my $result=$sqlsrv->sql($batch); return $result } sub destframe{ # StatusFrame # Get the data first my $statusboard=&GetData; #create a loop to populate the status frame my $count=1; foreach my $row (@$statusboard) { my $status="$$row{status}"; if ($status=="1") { $status="In"; }elsif ($status=="0"){ $status="Out"; }else{ $status="Not Set" } my $name=$statusFrame->Label(-text=>"$$row{firstname} $$row{la +stname}")->grid(-row=>"$count", -column=>"1"); my $status=$statusFrame->Label(-text=>"$status")->grid(-row=>" +$count", -column=>"2"); $count++; } } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Memory Leak
by BrowserUk (Patriarch) on Jan 05, 2009 at 23:17 UTC | |
|
Re: Memory Leak
by zentara (Cardinal) on Jan 05, 2009 at 22:51 UTC | |
|
Re: Memory Leak
by shmem (Chancellor) on Jan 05, 2009 at 22:53 UTC | |
|
Re: Memory Leak
by Anonymous Monk on Jan 06, 2009 at 17:41 UTC | |
by BrowserUk (Patriarch) on Jan 06, 2009 at 18:09 UTC |