in reply to Converting a parallel-serial shell script

I'm not sure if you would find this useful, but I wrote a module to pipe processes together. It also gives you a choice of whether you'd like to background the pipeline ala ( .. | .. | .. ) & using bg (exe .. , exe .. , exe ..)

Pipe processes and Perl subroutines together

Trying somewhat to emulate your imaginary API example:
use IPC::Exe; ## exports bg() & exe() my $parallel_handle = bg sub { my ($payload) = @_; ## Run one after another, but parallel wr +t to parent process ## &{ exe 'convert.sh', $payload, @ARGV }; die "Couldn't launch: $!/$?" if $! = $? > +> 8; &{ exe 'load_db.sh', $payload }; warn "Couldn't launch: $!/$?" if $! = $? +>> 8; }; my $payload = "ha ha!"; print "Background PID: ", $parallel_handle->($payload), "\n";