From 89f087ebd24a772e40d00c53d35a4319c90056b0 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Wed, 4 Feb 2009 10:41:53 -0500 Subject: [PATCH] Quick fix to remove the 'use' of Data::Parse for the whole script. --- check_postgres.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/check_postgres.pl b/check_postgres.pl index 81586b2df..ae2c929f7 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3749,7 +3749,13 @@ sub check_checkpoint { my $last = $1; ## Convert to number of seconds - use Date::Parse; + eval { + require Date::Parse; + import Date::Parse; + }; + if ($@) { + ndie "Must install the Perl module 'Date::Parse' to use the checkpoint action"; + } my $dt = str2time($last); if ($dt !~ /^\d+$/) { ndie qq{Unable to parse pg_controldata output: "$last"\n}; -- 2.39.5