in reply to Process order
#!/usr/bin/perl use strict; use warnings; my $input = 'a'; my %po = ( PR1 => 2, PR2 => 4, PR3 => 1, PR4 => 3, ); foreach my $key (sort { $po{$a} <=> $po{$b} } keys %po) { $key =~ s/^PR/process/; $input = eval "$key(\$input)" or die $@; print $input . $/; # debugging output } sub process1 { lc(shift) . 1 } sub process2 { lc(shift) . 2 } sub process3 { uc(shift) . 3 } sub process4 { uc(shift) . 4 }
A3 a31 A314 a3142
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Process order
by ikegami (Patriarch) on Jun 09, 2006 at 16:15 UTC | |
|
Re^2: Process order
by anniyan (Monk) on Jun 09, 2006 at 15:19 UTC |