[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 06:23:05 2009: Request 49619 was acted upon.
Transaction: Ticket created 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: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=49619 >


Dear, 

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

#!/usr/bin/perl
use warnings;
use strict;
use Carp;
use Win32::Process;

my $ProcessObj;
Win32::Process::Create( $ProcessObj,
                                'C:\Program Files\PSPad editor\PSPad.exe',
                                " test.txt",
                                0,
                                NORMAL_PRIORITY_CLASS,
                                ".") or die Win32::FormatMessage(
Win32::GetLastError() );

But this crash

#!/usr/bin/perl
use warnings;
use strict;
use Carp;

require Win32::Process;
my $ProcessObj;
Win32::Process::Create( $ProcessObj,
                                'C:\Program Files\PSPad editor\PSPad.exe',
                                " test.txt",
                                0,
                                NORMAL_PRIORITY_CLASS,
                                ".") or die Win32::FormatMessage(
Win32::GetLastError() );

Message : Bareword "NORMAL_PRIORITY_CLASS" not allowed while "strict subs"

If I use no strict 'subs';, the script work but I have a warning :
#!/usr/bin/perl
use warnings;
use strict;
use Carp;

no strict 'subs';
require Win32::Process;

my $ProcessObj;
Win32::Process::Create( $ProcessObj,
                                'C:\Program Files\PSPad editor\PSPad.exe',
                                " test.txt",
                                0,
                                NORMAL_PRIORITY_CLASS,
                                ".") or die Win32::FormatMessage(
Win32::GetLastError() );

Warning: Argument "NORMAL_PRIORITY_CLASS" isn't numeric in subroutine
entry at ...

Do you have an idea ?

Thank you.

Best Regards, 

Djibril
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.