in reply to Running a new Perl program
hope this helps,use Tk; use Win32::Process; use Win32; use strict; my $mw = MainWindow->new(); my $npBtn = $mw->Button(-text => "Notepad", -command => [\&run_prog, "C:\\winnt\\system32\ +\notepad.exe"] )->pack(); my $cBtn = $mw->Button(-text => "Calc", -command => [\&run_prog, "C:\\winnt\\system32\\ +calc.exe"] )->pack(); MainLoop; sub run_prog() { my $prog = shift; Win32::Process::Create($po, $prog, "", 0, NORMAL_PRIORITY_CLASS, "." ) || die &error(); } sub error() { print Win32::FormatMessage( Win32::GetLastError() ); }
|
|---|