#!/usr/bin/perl -w use strict; use Monitor; eval { Monitor::register($0, @ARGV); ### EXISTING CODE GOES HERE }; if ($@) { my $exc = $@; Monitor::exception($exc); die $exc }