#!/usr/bin/env perl use strict; use warnings; use DBI; use Carp; use English; # Load the .pm files from the current directory. Not really recommended, but it's fine for testing and debugging BEGIN { unshift @INC, '.'; }; use PDI; use Pitchover; use ContactLight; use EngineShutdown; my $dbh = DBI->connect('dburl', 'dbuser', 'dbpassword', {AutoCommit => 0, RaiseError => 0}) or croak($EVAL_ERROR); my @modules; push @modules, PDI->new(dbh => $dbh); push @modules, Pitchover->new(dbh => $dbh); push @modules, ContactLight->new(dbh => $dbh); push @modules, EngineShutdown->new(dbh => $dbh); foreach my $module (@modules) { if(!$module->executeProgram()) { $dbh->rollback; croak("Abort!"); } } # Tranquility base here, the Eagle has landed $dbh->commit;