in reply to Re^2: Graceful shutdowns and Parallel::ForkManager
in thread Graceful shutdowns and Parallel::ForkManager

just a quick comment...

sub max_processes  { 5; }
if you're trying to make this an inlined constant, you'll need to provide an empty prototype. i prefer making my constants ALL CAPS, and referring to them without a sigil. something like:

sub MAX_PROCESSES() { 5 }

and later...

$pm = Parallel::ForkManager->new(MAX_PROCESSES);

you'll find more info on this technique in perlsub.

~Particle *accelerates*

Replies are listed 'Best First'.
Re^4: Graceful shutdowns and Parallel::ForkManager
by atcroft (Abbot) on Jul 26, 2002 at 04:48 UTC

    I appreciate the heads' up that I was doing that incorrectly, and the reference to where to find how to do so properly. I have only just started to use that technique, and now, thanks to your assistance, will know better how to use it properly.

      Of course, to achieve the same effect, you could also simply

      use constant max_processes => 5;
      (or of course MAX_PROCESSES => 5;), which I personally find a more intuitive approach. Your mileage may, of course, vary. :-)



      If God had meant us to fly, he would *never* have given us the railroads.
          --Michael Flanders

        Appreciate the tip. Is that something that is available in 5.005.03?

        Update: Apparently it is-I just wanted to make sure since some of the code I work with resides on machines with perl 5.005.03.