use strict; use Tkx; use IPC :: Open3; my $ mw = Tkx :: widget-> new ('.'); my $ tw = $ mw-> new_text (); my $ bt = $ mw-> new_ttk__button ( -text => 'dir', -command => sub { my ($ rdr, $ pid); $ pid = open3 (undef, $ rdr, undef, 'dir'); $ tw-> insert ('end', do {local $ /; <$ rdr>}); }, ); Tkx :: pack ($ tw); Tkx :: pack ($ bt); Tkx :: MainLoop;
open3: Can't call method "close" on an undefined value at C: /perl5.8/lib/IPC/Open3.pm line 368. open3: Can't call method "close" on an undefined value at C: /perl5.8/lib/IPC/Open3.pm line 368.
#include <stdio.h> #include <windows.h> static char * ldr_file = "app.pl"; static char * ldr_path = ""; int main (int argc, char * argv []) { int code; LoadLibrary ("shell32.dll"); code = (int) ShellExecute (NULL, "open", ldr_file, ldr_path, NULL, SW_HIDE); if (code <= 32) { char buf [200]; sprintf (buf, "Cannot run application. Code:% d", code); MessageBox ( Null buf, "Dynld Error", MB_ICONERROR | MB_OK ); } return code; }
gcc -mwindows loader.c -o loader.exe
Source: https://habr.com/ru/post/67712/
All Articles