in reply to Process order
Which gives:#!/usr/bin/perl -w use strict; my %input = ( PR1 => 2, PR2 => 4, PR3 => 1, PR4 => 3, ); my %by_priority = reverse %input; foreach (sort keys %by_priority) { print $by_priority{$_}, "\n"; }
After sorting, I would use a hash of code references (as in davorg's reply) to execute the actual processes.$ ./foo.pl PR3 PR1 PR4 PR2
|
|---|