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: dji...@cpan.org
      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

Reply via email to