use warnings;
use strict;
-use Carp ();
+use Carp;
# NO EXTERNAL NON-5.8.1 CORE DEPENDENCIES EVER (e.g. C::A::G)
# This module is to be loaded by Makefile.PM on a pristine system
sub req_list_for {
my ($class, $group) = @_;
- Carp::croak "req_list_for() expects a requirement group name"
+ croak "req_list_for() expects a requirement group name"
unless $group;
my $deps = $reqs->{$group}{req}
- or Carp::croak "Requirement group '$group' does not exist";
+ or croak "Requirement group '$group' does not exist";
return { %$deps };
}
sub die_unless_req_ok_for {
my ($class, $group) = @_;
- Carp::croak "die_unless_req_ok_for() expects a requirement group name"
+ croak "die_unless_req_ok_for() expects a requirement group name"
unless $group;
$class->_check_deps($group)->{status}
sub req_ok_for {
my ($class, $group) = @_;
- Carp::croak "req_ok_for() expects a requirement group name"
+ croak "req_ok_for() expects a requirement group name"
unless $group;
return $class->_check_deps($group)->{status};
sub req_missing_for {
my ($class, $group) = @_;
- Carp::croak "req_missing_for() expects a requirement group name"
+ croak "req_missing_for() expects a requirement group name"
unless $group;
return $class->_check_deps($group)->{missing};
sub req_errorlist_for {
my ($class, $group) = @_;
- Carp::croak "req_errorlist_for() expects a requirement group name"
+ croak "req_errorlist_for() expects a requirement group name"
unless $group;
return $class->_check_deps($group)->{errorlist};
);
- open (my $fh, '>', $podfn) or Carp::croak "Unable to write to $podfn: $!";
- print $fh join ("\n\n", @chunks);
- print $fh "\n";
- close ($fh);
+ eval {
+ open (my $fh, '>', $podfn) or die;
+ print $fh join ("\n\n", @chunks) or die;
+ print $fh "\n" or die;
+ close ($fh) or die;
+ } or croak( "Unable to write $podfn: " . ( $! || $@ || 'unknown error') );
}
1;