in reply to Re: Win32::Process::Info and threads
in thread Win32::Process::Info and threads

I have tried do this:

use strict; use warnings; use Data::Dumper; use threads; sub include_info { require 'Win32::Process::Info'; } sub test { print "1"; } include_info; my $tid = threads->create(\&test)->join();

Result: Can't locate Win32::Process::Info in @INC

But use works. Could you explain my mistake?

Replies are listed 'Best First'.
Re^3: Win32::Process::Info and threads
by Corion (Patriarch) on Jan 17, 2017 at 15:04 UTC

      Thank you a lot!

Re^3: Win32::Process::Info and threads
by vr (Curate) on Jan 18, 2017 at 08:27 UTC

    This Win32::OLE hates Perl's threads too much... Then I'm afraid there's no other option but something like

    use strict; use warnings; use threads; use feature 'say'; sub test { my $s = 'say $_-> { CommandLine } for Win32::Process::Info-> new-> + GetProcInfo'; say qx( $^X -MWin32::Process::Info -E "$s" ); } threads-> create( \&test )-> join;

      Thank you for help