+2007-12-07 Andrew Ruthven
+ Better suppress warnings from the MythTV Perl API if we can't access
+ the database.
+
2007-12-06 Andrew Ruthven
Be more paranoid about handling error conditions in the
substitution code.
my $myth = undef;
eval { require MythTV };
- if (! $@) {
+ if ($@) {
+ print $@
+ if $verbose;
+ } else {
+ # Surpress warnings from DBI. I tried unsetting $^W but that is ignored.
+ local($SIG{__WARN__}) = sub { if ($verbose) { print shift } };
eval { $myth = new MythTV() };
}
my ($block) = @_;
$myth ||= load_perl_api();
- return "Unable to access MythTV Perl API."
+ return "Unable to access MythTV Perl API. Try with --verbose to find out why."
unless defined $myth;
my @lines;