Public Scratchpad | Download, Select Code To D/L |
include the codified version for easy copy/paste
Inspired by this blog (which was linked from dasgar's post):
C:\TEMP> mkdir tmp C:\TEMP> echo blah >> tmp\a.txt C:\TEMP> echo blah blah >> tmp\a.txt C:\TEMP> echo blah blah blah >> tmp\a.txt C:\TEMP> pp -o hello.exe -a tmp -e "use File::Spec; BEGIN { if(exists +$ENV{PAR_TEMP}) { my $d = File::Spec->catfile($ENV{PAR_TEMP}, 'inc'); + chdir $d or die qq(chdir '$d' failed: $!); }; }; open my $fh, '<', 'tmp/a.t +xt' or die qq(tmp/a.txt: $!); foreach (<$fh>) { print qq(a: $_); }" C:\TEMP> cd .. C:\> TEMP\hello.exe a: blah a: blah blah a: blah blah blah
That's pretty cool. While testing that out, I was using both my "system" strawberry perl and my berrybrew perls, and discovered that I need to cpanm --force PAR::Packer, because of a compiler warning/error during one of the testing steps (of sha1.c). It installs and seems to work, but given the message
... I am not sure that it will properly hash. (the 32bit perl installations didn't have that error, and so didn't need --force)gcc -c -s -O2 -DWIN32 -DWIN64 -DCONSERVATIVE -DPERL_TEXTMODE_SCRIPTS +-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fwrapv -fno-strict-alias +ing -mms-bitfields -I"C:\usr\local\apps\strawberry\perl\lib\CORE" - +DPARL_EXE=\"parl.exe\" -DPAR_PACKER_VERSION=\"1.036\" -s -O2 boot.c In file included from mktmpdir.h:85:0, from mktmpdir.c:1, from boot.c:10: sha1.c: In function 'sha_transform': sha1.c:146:2: warning: right shift count >= width of type T >>= 32; ^
then, if I do a batch wrapper which runscpanm --installdeps pp &rem need to make +sure all prereqs are in the non-locallib before starting the locallib + installation start cpanm -L .\locallib --look pp &rem will put the +`--look` shell in locallib mode copy some_other_icon.ico myldr\winres\pp.ico &rem update the ic +on; won't necessarily show updated icon in Explorer.exe unless you ru +n SHChangeNotify† cpanm --notest . &rem from same she +ll, so inherits the locallib from `--look` exit &rem leaves the `- +-look` shell
... I can call the locallib version of pp with its customized icon, thus ensuring that my out.exe has the customized iconsetlocal PATH=c:\path\to\locallib\bin;%PATH% &rem PATH=%~do0loc +allib\bin;%PATH% &rem ... the second works in a .bat/.cmd set PERL5LIB=C:\path\to\locallib\lib\perl5 &rem set PERL5LIB= +%~dp0locallib\lib\perl5 &rem ... the second works in a .bat/.cmd pp -x -o out.exe in.pl &rem see longer ve +rsion, below
pp --gui -M <lib#> ... --link=c:.../strawberry/c/bin/libexpat-1__. +dll -x -a myIcoin.ico -o out.exe in.pl + ^^^^^^^^^^^^^^ = use -a for embedding icons and other resource +s + ^^ = -x means get dependency from `perl in.pl`; -c means from `pe +rl -c in.pl` ^^^^^^^^ = may need to manually link DLLs; +can use procexp when the `perl in.pl` is running to see all the libra +ries ^^^^^^^^^^^^^ = if `in.pl` uses other modules, modules us +ed by those might not always be incorporated, so use one or more -M t +o ensure they get included ^^^^^ = do not include a console window in win32 executables
After recent discussions of Mojolicious::Lite login examples (first steps with Mojolicious::Lite and RFC / Audit: Mojo Login Example), and some of my recent thoughts about LDAP, the Need help with AWS Cognito question caught my eye: I would love to see one of the example M::L apps updated to use Login with Google, Login With Facebook, and similar for other OAuth providers (preferrably multiple providers at once).
This medium.com:@thomashelstrom article shows how he did a quick login-with-Google, which might be a good starting point.
Post Re: LWP::Authen::OAuth2 terminology describes possible procedure for using LWP::Authen::OAuth2 to login with google or similar
Even better, I decided to search Mojo for "OAuth2" and found Mojolicious::Plugin::OAuth2, which is exactly what I was thinking about without having to re-invent the wheel.
I had seen mention of FFI::Platypus before, but Re^2: Modernizing the Postmodern Language? had me take a quick look from a different perspective -- I had thought it was supposed to provide a way to access external libraries, but from the documentation I had linked before, I got too confused. This time, I was able to find an example of accessing kernel32.dll ... and with that, it might be possible to replace my monster amalgamation of Win32::API, Win32::GUI, and Win32::GuiTest -- though I might still want GuiTest separate during the module tests, because it's a pretty clean way for remote-controlling the GUI