[rt.cpan.org #49619] Bareword "NORMAL_PRIORITY_CLASS" not allowed while "strict subs"

[email protected] ("Djibril Ousmanou via RT")
Newsgroups perl.libwin32
Message-ID <[email protected]>
Fri Sep 11 09:15:15 2009: Request 49619 was acted upon.
Transaction: Correspondence added by DJIBEL
       Queue: Win32-Process
     Subject: Bareword "NORMAL_PRIORITY_CLASS" not allowed while "strict subs"
   Broken in: 0.14
    Severity: (no value)
       Owner: Nobody
  Requestors: [email protected]
      Status: open
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=49619 >


Le Ven. Sep. 11 08:28:04 2009, [email protected] a écrit :
> Djibril Ousmanou via RT wrote:
> > 
> > I have to call Win32::Process because my script have to work on Win32
> > and on Linux machine. Then, I tried to load the module using require but
> > I have some problems.
> > 
> > This code work well on Win32 machine
> ...
> > Warning: Argument "NORMAL_PRIORITY_CLASS" isn't numeric in subroutine
> > entry at ...
> > 
> > Do you have an idea ?
> 
> You need to import the constants you need, but I'm not sure how to get
> it to handle the import of constants properly.  You can workaround the
> error by declaring your own constants:
> 
> 	sub NORMAL_PRIORITY_CLASS { 0x00000020; }
> 	sub IDLE_PRIORITY_CLASS { 0x00000040; }
> 	sub HIGH_PRIORITY_CLASS { 0x00000080; }
> 	sub REALTIME_PRIORITY_CLASS { 0x00000100; }
> 
> or change them to
> 
> 	use constant NORMAL_PRIORITY_CLASS => 0x00000020;
> 	...
> 
> if you prefer.
> 

use constant NORMAL_PRIORITY_CLASS => 0x00000020; work well, thank you.

Can you explain me what's mean NORMAL_PRIORITY_CLASS ?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.