# Program In Program (PIP) safe_chdir('foo', 'Can't go to foo'); safe_system('foo --bar', 'foo didn\'t work'); safe_chdir('bar', 'bar is unreachable'); # Program In Data (PID) @program = ( [ chdir => 'foo', 'Can't go to foo' ], [ system => 'foo --bar', 'foo didn\'t work' ], [ chdir => 'bar', 'bar is unreachable' ], ); run_program(\@program); # Hiding the dispatch and loop processing in a sub.