From: Greg Sabino Mullane Date: Wed, 4 Feb 2009 15:41:53 +0000 (-0500) Subject: Quick fix to remove the 'use' of Data::Parse for the whole script. X-Git-Tag: 2.9.0~189 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=89f087ebd24a772e40d00c53d35a4319c90056b0;p=check_postgres.git Quick fix to remove the 'use' of Data::Parse for the whole script. --- 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};