Thanks Bob for your help. It didn't quite work as-is, but it got me where I needed to go.<br><br>Your BEGIN { eval{} || eval{} } construct went into the right path, but setting the scalar variables did not work. Instead they just took advantage of a syntax aid I didn't know about, where perl apparently helps out by assuming you meant to put quotes around barewords (i.e. $LOW_PRIORITY eq 'BELOW_NORMAL_PRIORITY_CLASS')<br>

<br>What are those $-less symbols from Win32::Process anyways? <br><br>But I was able to declare a $capable scalar, and have it set to 1 or 0 depending on the success of the import, which allowed me to take appropriate action later in the script.<br>

<br>AND (purists avert your eyes!) I discovered I don't even need the labels after all. I can simply<br><br>use Win32::Process;<br>$below_normal = 16384;<br>$above_normal = 32768;<br>#...<br>$proc->SetPriorityClass($below_normal);<br>

# OR<br>$proc->SetPriorityClass($above_normal);<br><br><br>TIMTOWDI<br><br>thanks again!<br><br>r<br><br><br> <br><br><div class="gmail_quote">On Wed, May 11, 2011 at 12:00 PM,  <span dir="ltr"><<a href="mailto:san-diego-pm-request@pm.org">san-diego-pm-request@pm.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Send San-Diego-pm mailing list submissions to<br>
        <a href="mailto:san-diego-pm@pm.org">san-diego-pm@pm.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mail.pm.org/mailman/listinfo/san-diego-pm" target="_blank">http://mail.pm.org/mailman/listinfo/san-diego-pm</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:san-diego-pm-request@pm.org">san-diego-pm-request@pm.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:san-diego-pm-owner@pm.org">san-diego-pm-owner@pm.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of San-Diego-pm digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Wrangle module version? (Reuben Settergren)<br>
   2. Re: Wrangle module version? (Bob Kleemann)<br>
   3. Re: help (Joel Fentin)<br>
   4. Re: help (Chris Grau)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 10 May 2011 14:47:43 -0700<br>
From: Reuben Settergren <<a href="mailto:ruberad@gmail.com">ruberad@gmail.com</a>><br>
To: <a href="mailto:san-diego-pm@pm.org">san-diego-pm@pm.org</a><br>
Subject: [San-Diego-pm] Wrangle module version?<br>
Message-ID: <BANLkTinWjrYOBBsy8h9GQmAAiz-pA=<a href="mailto:TCYg@mail.gmail.com">TCYg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hello Mongers,<br>
<br>
I have what seems like it should be a simple problem (and it probably is!),<br>
but I'm not finding the simple solution, so I'm hoping somebody can give me<br>
the right answer off the top of their head.<br>
<br>
So the group I work with shares a perl script to run multi-hour builds (of<br>
C++, on windows boxes, with visual studio 9). Usually we try to rebuild the<br>
whole shebang overnight, and then work on it all day. But sometimes we have<br>
to build during the day, and the computer can bog down.<br>
<br>
So yesterday I added this bitchin little tweak to allow the script to demote<br>
its own windows priority to "Below Normal", which in turn governs the<br>
priority of all the build tasks it spawns. Suddenly, it's a lot easier to<br>
get work done while the computer is building. Yay.<br>
<br>
But, I discovered today that not all of us developers have the same install<br>
of ActiveState (and it's not possible to mandate them to all upgrade to<br>
5.10), and older versions of Win32::Process do not offer the symbols<br>
BELOW_NORMAL_PRIORITY_CLASS and ABOVE_NORMAL_PRIORITY_CLASS (presumably<br>
because win2K or pre-win2K did not have those priorities), so they cannot<br>
<br>
    use Win32::Process qw[ BELOW_NORMAL_PRIORITY_CLASS<br>
ABOVE_NORMAL_PRIORITY_CLASS ];<br>
<br>
and the perl script borks.<br>
<br>
What I could do is modify the script so that the only possible<br>
priority-switching option is to change to LOW.<br>
<br>
What I'd rather do is allow every user access to every priority that their<br>
Win32::Process makes available to them. Is there a perl statement that will<br>
tell me whether Win32::Process is able to export the symbols I want, without<br>
actually trying to import them and killing the script?<br>
<br>
For reference, the trivial script below works for me, but not for the<br>
outdated. If this could be made to detect whether the symbols are available,<br>
and switch to low/high if they are not, that would solve my problem.<br>
<br>
<br>
<br>
use Win32::Process;<br>
use Win32::Process qw[ BELOW_NORMAL_PRIORITY_CLASS<br>
ABOVE_NORMAL_PRIORITY_CLASS ];<br>
<br>
my $pid = Win32::Process::GetCurrentProcessID();<br>
print "PID is $pid\n";<br>
<br>
$i = 100;<br>
$dt = 5;<br>
while ($i) {<br>
  print "Sleeping for $dt seconds; $i\n";<br>
  sleep $dt;<br>
  $i--;<br>
<br>
  my $proc;<br>
  if (Win32::Process::Open($proc, $pid, 0)) {<br>
    my $class;<br>
    $proc->GetPriorityClass($class);<br>
    print "Priority class is $class\n";<br>
    if ($i%2) {<br>
      print "Changing class to BELOW NORMAL\n";<br>
      $proc->SetPriorityClass(BELOW_NORMAL_PRIORITY_CLASS);<br>
    } else {<br>
      print "Changing class to ABOVE NORMAL\n";<br>
      $proc->SetPriorityClass(ABOVE_NORMAL_PRIORITY_CLASS);<br>
    }<br>
<br>
  } else {<br>
    print "Can't find myself as PID=$pid\n";<br>
  }<br>
<br>
}<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://mail.pm.org/pipermail/san-diego-pm/attachments/20110510/63e364d5/attachment-0001.html" target="_blank">http://mail.pm.org/pipermail/san-diego-pm/attachments/20110510/63e364d5/attachment-0001.html</a>><br>


<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 10 May 2011 21:01:36 -0700<br>
From: Bob Kleemann <<a href="mailto:rkleeman@energoncube.net">rkleeman@energoncube.net</a>><br>
To: Reuben Settergren <<a href="mailto:ruberad@gmail.com">ruberad@gmail.com</a>><br>
Cc: <a href="mailto:san-diego-pm@pm.org">san-diego-pm@pm.org</a><br>
Subject: Re: [San-Diego-pm] Wrangle module version?<br>
Message-ID: <BANLkTimnxQapK=<a href="mailto:EyD3R4i63Wg0T7j8%2BPaA@mail.gmail.com">EyD3R4i63Wg0T7j8+PaA@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Since I don't have a Windows box to test this on, I'm not sure, but<br>
you could try something like<br>
<br>
our $LOW_PRIORITY;<br>
BEGIN {<br>
  require Win32::Process;<br>
  eval {<br>
    Win32::Process->import(qw[<br>
      BELOW_NORMAL_PRIORITY_CLASS<br>
      ABOVE_NORMAL_PRIORITY_CLASS<br>
    ]);<br>
    $LOW_PRIORITY = BELOW_NORMAL_PRIORITY_CLASS;<br>
  }<br>
  || eval {<br>
    Win32::Process->import(qw[ LOW ])<br>
    $LOW_PRIORITY = LOW;<br>
  };<br>
}<br>
<br>
Then proceed to use $LOW_PRIORITY where you would normally use<br>
BELOW_NORMAL_PRIORITY_CLASS.<br>
<br>
2011/5/10 Reuben Settergren <<a href="mailto:ruberad@gmail.com">ruberad@gmail.com</a>>:<br>
> Hello Mongers,<br>
><br>
> I have what seems like it should be a simple problem (and it probably is!),<br>
> but I'm not finding the simple solution, so I'm hoping somebody can give me<br>
> the right answer off the top of their head.<br>
><br>
> So the group I work with shares a perl script to run multi-hour builds (of<br>
> C++, on windows boxes, with visual studio 9). Usually we try to rebuild the<br>
> whole shebang overnight, and then work on it all day. But sometimes we have<br>
> to build during the day, and the computer can bog down.<br>
><br>
> So yesterday I added this bitchin little tweak to allow the script to demote<br>
> its own windows priority to "Below Normal", which in turn governs the<br>
> priority of all the build tasks it spawns. Suddenly, it's a lot easier to<br>
> get work done while the computer is building. Yay.<br>
><br>
> But, I discovered today that not all of us developers have the same install<br>
> of ActiveState (and it's not possible to mandate them to all upgrade to<br>
> 5.10), and older versions of Win32::Process do not offer the symbols<br>
> BELOW_NORMAL_PRIORITY_CLASS and ABOVE_NORMAL_PRIORITY_CLASS (presumably<br>
> because win2K or pre-win2K did not have those priorities), so they cannot<br>
><br>
> ??? use Win32::Process qw[ BELOW_NORMAL_PRIORITY_CLASS<br>
> ABOVE_NORMAL_PRIORITY_CLASS ];<br>
><br>
> and the perl script borks.<br>
><br>
> What I could do is modify the script so that the only possible<br>
> priority-switching option is to change to LOW.<br>
><br>
> What I'd rather do is allow every user access to every priority that their<br>
> Win32::Process makes available to them. Is there a perl statement that will<br>
> tell me whether Win32::Process is able to export the symbols I want, without<br>
> actually trying to import them and killing the script?<br>
><br>
> For reference, the trivial script below works for me, but not for the<br>
> outdated. If this could be made to detect whether the symbols are available,<br>
> and switch to low/high if they are not, that would solve my problem.<br>
><br>
><br>
><br>
> use Win32::Process;<br>
> use Win32::Process qw[ BELOW_NORMAL_PRIORITY_CLASS<br>
> ABOVE_NORMAL_PRIORITY_CLASS ];<br>
><br>
> my $pid = Win32::Process::GetCurrentProcessID();<br>
> print "PID is $pid\n";<br>
><br>
> $i = 100;<br>
> $dt = 5;<br>
> while ($i) {<br>
> ? print "Sleeping for $dt seconds; $i\n";<br>
> ? sleep $dt;<br>
> ? $i--;<br>
><br>
> ? my $proc;<br>
> ? if (Win32::Process::Open($proc, $pid, 0)) {<br>
> ??? my $class;<br>
> ??? $proc->GetPriorityClass($class);<br>
> ??? print "Priority class is $class\n";<br>
> ??? if ($i%2) {<br>
> ????? print "Changing class to BELOW NORMAL\n";<br>
> ????? $proc->SetPriorityClass(BELOW_NORMAL_PRIORITY_CLASS);<br>
> ??? } else {<br>
> ????? print "Changing class to ABOVE NORMAL\n";<br>
> ????? $proc->SetPriorityClass(ABOVE_NORMAL_PRIORITY_CLASS);<br>
> ??? }<br>
><br>
> ? } else {<br>
> ??? print "Can't find myself as PID=$pid\n";<br>
> ? }<br>
><br>
> }<br>
><br>
><br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> San-Diego-pm mailing list<br>
> <a href="mailto:San-Diego-pm@pm.org">San-Diego-pm@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/san-diego-pm" target="_blank">http://mail.pm.org/mailman/listinfo/san-diego-pm</a><br>
><br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 11 May 2011 10:08:52 -0700<br>
From: Joel Fentin <<a href="mailto:joel@fentin.com">joel@fentin.com</a>><br>
To: Christopher Hart <<a href="mailto:christopher.p.hart@gmail.com">christopher.p.hart@gmail.com</a>><br>
Cc: San Diego Perl Mongers <<a href="mailto:san-diego-pm@pm.org">san-diego-pm@pm.org</a>>, <a href="mailto:lasvegas-pm@pm.org">lasvegas-pm@pm.org</a><br>
Subject: Re: [San-Diego-pm] help<br>
Message-ID: <<a href="mailto:4DCAC2A4.3040703@fentin.com">4DCAC2A4.3040703@fentin.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
On 5/9/2011 1:39 PM, Christopher Hart wrote:<br>
> Hi Joel,<br>
><br>
> I've seen browsers behave poorly over the . (cwd) in @INC.<br>
> Have you tried doing 'use lib qw(.);' or 'use lib qw(<br>
> /path/to/public_html/cgi-bin );' ?<br>
<br>
Chris,<br>
<br>
Thank you for getting back to me.<br>
<br>
To the extent that I understand (which ain't much), you think the<br>
problem is tied to the browser. If so, I would expect different<br>
results with Chrome, IE, & FF. I get identical results.<br>
<br>
I once dropped this same module into cgi-bin in Hurricane Electric<br>
and didn't have these problems. My own suspicion is that<br>
networksolutions has set up security such that I have to present<br>
the path in a certain format. I called them and they have various<br>
levels of experts. The guy at the third level is taking his sweet<br>
time getting back to me.<br>
<br>
More later if I learn anything.<br>
<br>
> On Mon, May 9, 2011 at 11:24 AM, Joel Fentin <<a href="mailto:joel@fentin.com">joel@fentin.com</a><br>
> <mailto:<a href="mailto:joel@fentin.com">joel@fentin.com</a>>> wrote:<br>
><br>
>     Had to install Image::Size in cgi-bin. networksolutions won't<br>
>     install perl modules.<br>
><br>
>     error message:<br>
><br>
>     Can't locate auto/Image/Size/<a href="http://jpegsize.al" target="_blank">jpegsize.al</a> <<a href="http://jpegsize.al" target="_blank">http://jpegsize.al</a>><br>
>     in @INC<br>
>     (@INC contains: ../<br>
>     ../Image<br>
>     ../auto/Image/<br>
>     ./auto/Image/Size/<br>
>     auto/Image/Size/<a href="http://jpegsize.al" target="_blank">jpegsize.al</a> <<a href="http://jpegsize.al" target="_blank">http://jpegsize.al</a>><br>
>     auto/Image/Size/<br>
>     ../auto/Image/Size/<br>
>     /usr/lib/perl5/5.8.7/i686-linux<br>
>     /usr/lib/perl5/5.8.7<br>
>     /usr/lib/perl5/site_perl/5.8.7/i686-linux<br>
>     /usr/lib/perl5/site_perl/5.8.7<br>
>     /usr/lib/perl5/site_perl<br>
>     /usr/lib/perl5/vendor_perl/5.8.7/i686-linux<br>
>     /usr/lib/perl5/vendor_perl/5.8.7<br>
>     /usr/lib/perl5/vendor_perl .)<br>
>     at ..//Image/Size.pm line 213<br>
><br>
>     Addional notes:<br>
><br>
>     + I have dropped <a href="http://jpegsize.al" target="_blank">jpegsize.al</a> <<a href="http://jpegsize.al" target="_blank">http://jpegsize.al</a>> all over the<br>
>     place and have changed permissions to 755.<br>
><br>
>     + I have added everything I can think of to @INC.<br>
><br>
>     + current directory is /public_html/cgi-bin/Admin as is the<br>
>     application program.<br>
><br>
>     + Where the files are:<br>
>     /public_html/cgi-bin/auto/Image/Size/<a href="http://jpegsize.al" target="_blank">jpegsize.al</a><br>
>     <<a href="http://jpegsize.al" target="_blank">http://jpegsize.al</a>> (& elsewhere)<br>
>     /public_html/cgi-bin/Image/Size.pm<br>
><br>
>     I'm going in circles and don't know what it wants.<br>
><br>
>     --<br>
>     Joel Fentin       tel: <a href="tel:760-749-8863" value="+17607498863">760-749-8863</a> <tel:<a href="tel:760-749-8863" value="+17607498863">760-749-8863</a>><br>
>     Biz Website: <a href="http://fentin.com" target="_blank">http://fentin.com</a><br>
>     Personal Website: <a href="http://fentin.com/me" target="_blank">http://fentin.com/me</a><br>
>     _______________________________________________<br>
>     San-Diego-pm mailing list<br>
>     <a href="mailto:San-Diego-pm@pm.org">San-Diego-pm@pm.org</a> <mailto:<a href="mailto:San-Diego-pm@pm.org">San-Diego-pm@pm.org</a>><br>
>     <a href="http://mail.pm.org/mailman/listinfo/san-diego-pm" target="_blank">http://mail.pm.org/mailman/listinfo/san-diego-pm</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Respectfully,<br>
><br>
> Chris Hart<br>
> Senior Internet Engineer,<br>
> ZeroLag Communications, Inc.<br>
> <a href="http://www.zerolag.com" target="_blank">http://www.zerolag.com</a><br>
><br>
<br>
<br>
--<br>
Joel Fentin       tel: <a href="tel:760-749-8863" value="+17607498863">760-749-8863</a><br>
Biz Website:      <a href="http://fentin.com" target="_blank">http://fentin.com</a><br>
Personal Website: <a href="http://fentin.com/me" target="_blank">http://fentin.com/me</a><br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Wed, 11 May 2011 11:08:23 -0700<br>
From: Chris Grau <<a href="mailto:chris@chrisgrau.com">chris@chrisgrau.com</a>><br>
To: Joel Fentin <<a href="mailto:joel@fentin.com">joel@fentin.com</a>><br>
Cc: San Diego Perl Mongers <<a href="mailto:san-diego-pm@pm.org">san-diego-pm@pm.org</a>><br>
Subject: Re: [San-Diego-pm] help<br>
Message-ID: <BANLkTinW9CcJ1YKyfMqJwswearpBH7=<a href="mailto:Deg@mail.gmail.com">Deg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Your paths appear correct, according to the @INC listed in the error.<br>
The only oddity is the file itself appearing in @INC, but I assume<br>
it's because you were trying everything, including adding the file to<br>
the list.<br>
<br>
What's the file type of your <a href="http://jpegsize.al" target="_blank">jpegsize.al</a> file (output of 'file <a href="http://jpegsize.al" target="_blank">jpegsize.al</a>')?<br>
<br>
What's the system type of the host (output of 'uname -a')?<br>
<br>
On Mon, May 9, 2011 at 11:24 AM, Joel Fentin <<a href="mailto:joel@fentin.com">joel@fentin.com</a>> wrote:<br>
> Had to install Image::Size in cgi-bin. networksolutions won't install perl<br>
> modules.<br>
><br>
> error message:<br>
><br>
> Can't locate auto/Image/Size/<a href="http://jpegsize.al" target="_blank">jpegsize.al</a> in @INC<br>
> (@INC contains: ../<br>
> ../Image<br>
> ../auto/Image/<br>
> ./auto/Image/Size/<br>
> auto/Image/Size/<a href="http://jpegsize.al" target="_blank">jpegsize.al</a><br>
> auto/Image/Size/<br>
> ../auto/Image/Size/<br>
> /usr/lib/perl5/5.8.7/i686-linux<br>
> /usr/lib/perl5/5.8.7<br>
> /usr/lib/perl5/site_perl/5.8.7/i686-linux<br>
> /usr/lib/perl5/site_perl/5.8.7<br>
> /usr/lib/perl5/site_perl<br>
> /usr/lib/perl5/vendor_perl/5.8.7/i686-linux<br>
> /usr/lib/perl5/vendor_perl/5.8.7<br>
> /usr/lib/perl5/vendor_perl .)<br>
> at ..//Image/Size.pm line 213<br>
><br>
> Addional notes:<br>
><br>
> + I have dropped <a href="http://jpegsize.al" target="_blank">jpegsize.al</a> all over the place and have changed permissions<br>
> to 755.<br>
><br>
> + I have added everything I can think of to @INC.<br>
><br>
> + current directory is /public_html/cgi-bin/Admin as is the application<br>
> program.<br>
><br>
> + Where the files are:<br>
> /public_html/cgi-bin/auto/Image/Size/<a href="http://jpegsize.al" target="_blank">jpegsize.al</a> (& elsewhere)<br>
> /public_html/cgi-bin/Image/Size.pm<br>
><br>
> I'm going in circles and don't know what it wants.<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
San-Diego-pm mailing list<br>
<a href="mailto:San-Diego-pm@pm.org">San-Diego-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/san-diego-pm" target="_blank">http://mail.pm.org/mailman/listinfo/san-diego-pm</a><br>
<br>
End of San-Diego-pm Digest, Vol 85, Issue 3<br>
*******************************************<br>
</blockquote></div><br>