in reply to Can a perl script on windows set it's self priority level?

Yes, SetPriorityClass in Win32::Process calls the system call with the same name.

The code would look like

use Win32::Process qw( HIGH_PRIORITY_CLASS ); Win32::Process::Open(my $proc, $$, 0) or die($^E); $proc->SetPriorityClass(HIGH_PRIORITY_CLASS) or die($^E);

Update: Added parameter missing from call to Open, as mentioned in a reply.

Replies are listed 'Best First'.
Re^2: Can a perl script on windows set it's self priority level?
by Eradicatore (Monk) on Dec 19, 2007 at 20:09 UTC
    Awesome! Thanks! Note that I had to add one more parameter to the call to Win32::Process::Open(). For activestate, it takes "iflags" as third parameter.

    $iflags flag: inherit calling processes handles or not

    Justin Eltoft