package include;

use strict;
use warnings;

use Exporter;
our @ISA = ("Exporter");
our @EXPORT = qw(
  &debug &croak &carp &center &longest
);

use Data::Dumper;
use Carp;

# Data::Dumpers everything it gets to STDERR.
sub debug {
  print STDERR Dumper(@_);
}

# Provide the offset to center something.
sub center {
  my ($thing, $max) = @_;
  $thing = length($thing) unless $thing =~ m/^\d+$/;
  return int($max / 2) - int($thing / 2);
}

# Return the length of the longest member
sub longest {
  my $len = 0;
  foreach (@_) {
    $len = length($_) if length($_) > $len;
  }
  return $len;
}

42;
